我正在尝试通过 javascript 创建一个公共要点。我没有使用任何身份验证 - 这都是客户端。
var gist = {
"description": "test",
"public": true,
"files": {
"test.txt": {
"content": "contents"
}
}
};
$.post('https://api.github.com/gists', gist, function(data) {
});
上面的代码抛出 400: Bad Request - Problems parsing JSON。但是,我的 JSON 是有效的。有任何想法吗?