我正在尝试使用API为GitHub问题添加标签。检查API documentation后,我尝试了以下curl
请求:
curl -X POST -H "Authorization: token OOOOOOOOOOOOOOOO" -H \
"Accept: application/vnd.github.symmetra-preview+json" \
-d @label.json https://api.github.com/repos/CHSUNSONG/star-platform/issues/11
label.json
包含:
["submitted"]
但是,我收到了以下回复:
{
"message": "Invalid request.\n\nFor 'links/1/schema', [\"submitted\"] is not an object.",
"documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue"
}
为什么这不起作用,我该如何解决?
答案 0 :(得分:0)
您正在发布错误的网址。将/labels
添加到最后:
curl -X POST -H "Authorization: token OOOOOOOOOOOOOOOO" -H \
"Accept: application/vnd.github.symmetra-preview+json" \
-d @label.json \
https://api.github.com/repos/CHSUNSONG/star-platform/issues/11/labels