| title | Git Blobs | GitHub API |
|---|
- TOC {:toc}
Since blobs can be any arbitrary binary data, the input and responses
for the blob API takes an encoding parameter that can be either utf-8
or base64. If your data cannot be losslessly sent as a UTF-8 string,
you can base64 encode it.
Blobs leverage these custom media types. You can read more about the use of media types in the API here.
GET /repos/:owner/:repo/git/blobs/:sha
Note: This API supports blobs up to 100 megabytes in size.
<%= headers 200 %> <%= json(:blob) %>
POST /repos/:owner/:repo/git/blobs
<%= json :content => "Content of the blob", :encoding => "utf-8" %>
<%= headers 201, :Location => get_resource(:blob_after_create)['url'] %> <%= json :blob_after_create %>
These are the supported media types for blobs. You can read more about the use of media types in the API here.
application/json
application/vnd.github.VERSION.raw