您好我正在使用HTTPClient发送POST请求。这里我传递了一些有一些数组的JSON数据。
{
"pccpId": "11111",
"courseId": "XXXXX",
"employeeId": "XXXXXX",
"userId": "X!@#$",
"assignments": [
{
"Id": "XXXX",
"targetDate": "05/30/2018",
"targetNewDate": "04/30/2018"
},
{
"Id": "YYYYY",
"targetDate": "04/22/2018",
"targetNewDate": "04/26/2018"
}
]
}
当我使用这些数据时,我收到400错误代码。当我用后端检查时根本没有碰到服务器。当我在Postman上运行时,相同的数据给出了预期的结果。
任何人都有任何建议!!
由于
答案 0 :(得分:0)
我有这个pb with titanium nodeJS api,解决方法是将你的数据字符串化并在服务器上解析它
答案 1 :(得分:0)
尝试使用没有双引号的密钥,例如
{
pccpId: "11111",
courseId: "XXXXX",
employeeId: "XXXXXX",
userId: "X!@#$",
assignments: [{
"Id": "XXXX",
"targetDate": "05/30/2018",
"targetNewDate": "04/30/2018"
},
{
"Id": "YYYYY",
"targetDate": "04/22/2018",
"targetNewDate": "04/26/2018"
}
]
}