我的有效载荷看起来像这样。
var data={
"workspace":"1234",
"name": task_name ,
"notes":striped_msg ,
"memberships":[
{
"project":678,
"section":111
},
{
"project":1230
}
],
"custom_fields":{
"303093523672299":"303093523672300"
},
"due_on":string_date
}
像这样发送有效载荷。
var status = await asanaService.addTask(JSON.stringify(data))
得到以下错误消息
{"errors":[{"message":"Could not interpret {\"workspace\":"1234",\"name\":\"rohit as an identifier in {\"workspace\":"1234",\"name\":\"rohit.one [ Mysql cpu ]\",\"notes\":..............","help":"For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"}]}
答案 0 :(得分:0)
我在发布期间缺少JSON标头