Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commitdc1d5ab

Browse files
committed
Merge pull request#559 from github/nh/repo-contents-directories
Document the media type param for directories
2 parents8be9d4c +c03ef51 commitdc1d5ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎content/v3/repos/contents.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This method returns the contents of a file or directory in a repository.
3636
GET /repos/:owner/:repo/contents/:path
3737

3838
Files and symlinks support[a custom media type](#custom-media-types) for retrieving the raw content or rendered HTML (when supported).
39-
Directories and submodules do_not_support custom media types.
39+
All content typessupport[acustom mediatype](#custom-media-types) to ensure the content is returned in a consistent object format.
4040

4141
{{#tip}}
4242

@@ -284,4 +284,11 @@ Use the `.raw` media type to retrieve the contents of the file.
284284

285285
For markup files such as Markdown or AsciiDoc, you can retrieve the rendered HTML using the`.html` media type. Markup languages are rendered to HTML using our open-source[Markup library](https://github.com/github/markup).
286286

287+
[All objects](#get-contents) support the following custom media type:
288+
289+
application/vnd.github.VERSION.object
290+
291+
Use the`object` media type parameter to retrieve the contents in a consistent object format regardless of the content type. For example, instead of an array of objects
292+
for a directory, the response will be an object with an`entries` attribute containing the array of objects.
293+
287294
You can read more about the use of media types in the API[here](/v3/media/).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp