【发布时间】:2015-07-01 12:02:04
【问题描述】:
我正在尝试向 Square 发送消息以创建项目
var postData = {
"name": "Milkshake",
"variations": [
{
"name": "Small",
"pricing_type": "FIXED_PRICING",
"price_money": {
"currency_code": "USD",
"amount": 400
}
}
]}
request.post({
uri:"https://connect.squareup.com/v1/me/items",
headers:{'Authorization': 'Bearer ' + access_token,
'Accept': 'application/json',
'Content-Type': 'application/json'},
body: querystring.stringify(postData)
},function(err,res,body){
console.log(res.statusCode);
console.log(body); });
但我从 Square 收到这条消息
{"type":"bad_request","message":"invalid json"}
【问题讨论】:
标签: node.js request square-connect