通过HTTP API将图像发布到Gist [英] Posting images to Gists via the HTTP API

查看:86
本文介绍了通过HTTP API将图像发布到Gist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过HTTP API将二进制文件(例如图像)发布到GitHub gists? Gist api文档描述如何发布带有字符串内容的文件。上传图片有两个问题。其中一个就是api的POST请求有64kb的限制(尽管这没有记录),这对于图像文件来说很小。其次,图像文件的线路上应该使用何种编码并不明显。

通过克隆与Gist关联的git存储库,添加文件并推送到存储库很容易,但这需要git,而且我希望

解决方案

我从GitHub收到的回复是,他们不打算支持发布通过HTTP API将二进制文件发送给Gist,不幸的是。

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.

解决方案

The response I received from GitHub is that they don't intend to support posting binary files to Gists via the HTTP API, sadly.

这篇关于通过HTTP API将图像发布到Gist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆