GitHub 问题创建 API

use*_*972 5 bash curl github

我正在尝试使用 GitHub 存储库创建问题:

curl -d '{"title":"my-new-repo","body":"my new issue description"}' https://api.github.com/repos/np98765/BattleKits/issues
Run Code Online (Sandbox Code Playgroud)

这只是返回:

{
  "message": "Not Found"
}
Run Code Online (Sandbox Code Playgroud)

我是这样认证的:

curl -u "user:password" https://api.github.com
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么? http://developer.github.com/v3/issues/#create-an-issue

Von*_*onC 2

你似乎没有提出POST你的curl要求。

您至少可以尝试(遵循“ REST-esting with cURL ”):

curl -X POST -i -d '{"title":"my-new-repo","body":"my new issue description"}' https://api.github.com/repos/np98765/BattleKits/issues
Run Code Online (Sandbox Code Playgroud)

用于-i查看响应标头。

  • 当使用“-d”时,curl 应始终使用 POST。 (2认同)