gpt4 book ai didi

curl - Github API 错误 - { "message": "Not Found", "documentation_url": "https://developer.github.com/v3"} 在 cURL 终端中制作 repo

转载 作者:行者123 更新时间:2023-12-04 11:36:40 25 4
gpt4 key购买 nike

api 是 v3,我试图制作一个工具的原因是当你输入你的 github 用户名和密码以及 repo 名称和描述时,它会初始化 repo 并给你 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"
}

.文档是这样说的:为经过身份验证的用户创建一个新的存储库。 POST/用户/存储库。 https://developer.github.com/v3/repos/#create .我对 github-api 很陌生,感谢您的帮助。

最佳答案

看到这个 curl tutorial用于您的 GitHub API 调用

POST

Use the --request (-X) flag along with --data (-d) to POST data

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

Of course --data implies POST so you don't have to also specify the --request flag

curl --user "caspyin" --data '{"description":"Created via API","public":"true","files":{"file1.txt":{"content":"Demo"}}' https://api.github.com/gists

关于curl - Github API 错误 - { "message": "Not Found", "documentation_url": "https://developer.github.com/v3"} 在 cURL 终端中制作 repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58315409/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com