无法通过API上传github发布资源 [英] Cannot upload github release asset through API
本文介绍了无法通过API上传github发布资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个没有资产的github版本:
I have a github release with no assets yet:
$ curl https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets
[
]
但是我不能上传资产到此版本:
$ curl -X POST --header "Content-Type:application/edn" --data-binary @cljsdocs-full.edn "https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets?name=full.edn&access_token=$(cat my-token)"
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}
我的api访问令牌具有public_repo
访问权限.感谢您在上传此资产方面的帮助.
my api access token has public_repo
access. Thanks for any helping on uploading this asset.
推荐答案
您正在向 https://uploads.github.com/repos/cljsinfo/api-docs /releases/1260660/assets .
You're making the POST request to https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets which is not the upload URL for the release. It should be https://uploads.github.com/repos/cljsinfo/api-docs/releases/1260660/assets.
有关更多信息,请参阅文档:
See the docs for more info:
https://developer.github.com/v3/repos/releases/#upload-a-release-asset
这篇关于无法通过API上传github发布资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文