You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: content/v3/repos/contents.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ This method returns the contents of a file or directory in a repository.
36
36
GET /repos/:owner/:repo/contents/:path
37
37
38
38
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.
40
40
41
41
{{#tip}}
42
42
@@ -284,4 +284,11 @@ Use the `.raw` media type to retrieve the contents of the file.
284
284
285
285
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).
286
286
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
+
287
294
You can read more about the use of media types in the API[here](/v3/media/).