问题
Is it possible to post binary files (such as images) to GitHub gists via the HTTP api?
In particular, the Gist api docs describe how to post files with string contents. There are two problems here for uploading images. One is that the api has something like a 64kb limit on POST requests (although this is not documented), which is pretty small for image files. Second, it's not obvious what encoding should be used on the wire for image files.
It's easy to do this by cloning the git repository associated with the Gist, adding the file, and pushing to the repository, but that requires git and I'd like to make this work on systems without git installed.
回答1:
The response I received from GitHub is that they don't intend to support posting binary files to Gists via the HTTP API, sadly.
来源:https://stackoverflow.com/questions/9770562/posting-images-to-gists-via-the-http-api