如何避免
的解析错误curl -H 'Accept: application/vnd.github.VERSION.raw' -XPUT -g 'https://api.github.com/repos/USER/l1/contents/PATH/FILENAME.json?ref=gh-pages&access_token=57eef6413b12cb439b837b8fc4751b3291650de1' -d '{
"message": "update from api",
"committer": {
"name": "USER",
"email": "USERe@MAIL.com"
},
"content": "[{"a": "aaa","b": "bbb"}]",
"sha": "c321fe9f6418053ecb87eb3cd2518a4xdfc83ebf"
}'
答案:
{
"message": "**Problems parsing JSON**",
"documentation_url": "https://developer.github.com/v3/repos/contents/"
}
而不是
"[{"a": "aaa","b": "bbb"}]"
我已经尝试了
"[{\"a\": \"aaa",\"b\": \"bbb\"}]"
然后我收到以下错误:
{
"message": "**content is not valid Base64**",
"documentation_url": "https://developer.github.com/v3/repos/contents/"
}
最佳,