相关疑难解决方法(0)

如何将图像上传到要点?

如何将图像上传到要点?

看看这个:https: //gist.github.com/mbostock/5503544#file-thumbnail-png

我所尝试的是在一个要点的编辑模式下拖放图像文件.这似乎不适用于Crhome和FireFox.

更新:使用GitHub来回发送电子邮件后,不支持此功能(拖放二进制文件,图像).

gist github

127
推荐指数
4
解决办法
3万
查看次数

使用curl使用Github API v3创建新的要点

经过相当长的一段时间,使用他们的API V3向Github发布私人要点后,我几乎放弃了.几乎.也许有些人也遇到过类似问题或者知道可能是以下行为的原因:

现在curl命令如下所示:

curl -H "Authorization: bearer MY_AUTHORIZATION_TOKE" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"public":false,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists
Run Code Online (Sandbox Code Playgroud)

我也试过了

curl -H "Authorization: bearer MY_AUTHORIZATION_TOKE" -X POST -d '{"public":false,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists
Run Code Online (Sandbox Code Playgroud)

我可以使用完全相同的数据创建没有授权令牌的gist:

curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists
Run Code Online (Sandbox Code Playgroud)

但在这种情况下,它将是匿名的

如果我想将其公之于众,那么结果相同

无论如何,Github都会回来

HTTP/1.1 404 Not Found
{
  "message": "Not Found"
}
Run Code Online (Sandbox Code Playgroud)

我很确定我已经获得授权,因为curl -H "Authorization: bearer MY_AUTHORIZATION_TOKE" https://api.github.com/user我将用户详细信息返回给我.

适用范围如下:

https://github.com/login/oauth/authorize?client_id=...&scope=gist

因此,它应该具有读取和写入权限.

json curl gist github-api

6
推荐指数
1
解决办法
4767
查看次数

How to create a GitHub Gist with API?

By looking at GitHub Gist API, I understood that it is possible to create the Gist create for anonymous users without any API keys/authentication. Is it so?

I could not find answers to following questions:

  1. Are there any restrictions (number of gists) to be created etc?
  2. Is there any example that I can post the code from a form text input field to create a gist? I could not find any.

Thanks for any information about this.

php api gist github

4
推荐指数
1
解决办法
3446
查看次数

标签 统计

gist ×3

github ×2

api ×1

curl ×1

github-api ×1

json ×1

php ×1