api是v3,是我试图制作一个工具的原因,以便当您输入github的用户名和密码以及回购名称和描述时,它将初始化回购并给出url。我的意见是-
curl -u {myuser}:{mypassword} -H "Content-Type: application/json" -d '{"name":"api-test","description":"made with github api","homepage": "https://github.com","private":true}' POST https://api.github.com/users/{myuser}/repos我得到了回应
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}。文档说:为经过身份验证的用户创建一个新的存储库。发布/用户/回复。https://developer.github.com/v3/repos/#create。我对github非常陌生,感谢帮助。
发布于 2019-10-10 04:39:10
有关卷曲教程 API调用,请参阅此GitHub
帖子 将
--request(-X)标志与--data(-d)一起用于POST数据
curl --user "caspyin" --request POST --data '{"description":"Created via API","public":"true","files":{"file1.txt":{"content":"Demo"}}' https://api.github.com/gists
curl --user "caspyin" -X POST --data '{"description":"Created via API","public":"true","files":{"file1.txt":{"content":"Demo"}}' https://api.github.com/gists当然,数据意味着POST,所以您不必也指定--请求标志。
curl --user "caspyin" --data '{"description":"Created via API","public":"true","files":{"file1.txt":{"content":"Demo"}}' https://api.github.com/gists发布于 2019-10-10 05:13:57
好的我知道了。我只是用错了网址。这就是我所做的
curl --user "{user}:{password}" -X POST -d '{"name":"api-test","description":"made with github api","private":"true","homepage":"https://github.com"}' \\ https://api.github.com/user/repos // <- IMPORTANT PARThttps://stackoverflow.com/questions/58315409
复制相似问题