Posting images to Gists via the HTTP API

江枫思渺然 提交于 2019-12-10 03:58:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!