对于使用 kinvey 控制台的任何人 - 我正在尝试通过 API 控制台向自定义端点发出简单的发布请求,但收到 jsonParse 错误。
端点代码是 -
function onRequest(request, response, modules){
modules.logger.info(request.body.name + " has " + request.body.eyes + " eyes.");
response.complete(200);
}
请求——
POST https://baas.kinvey.com/rpc/kid_TVdEjbOoXi/custom/test HTTP/1.1
Authorization: "xxx" //my authorization number
X-Kinvey-API-Version: 3
Content-Type: application/json
{
"name": "Fred Jones",
"eyes": "Blue"
}
响应
HTTP/1.1 400
Content-Type: application/json
X-Kinvey-Request-Id: "XXX" // the request id
X-Powered-By: Express
{
"error": "JSONParseError",
"description": "Unable to parse the JSON in the request",
"debug": "Unexpected token a"
}
有谁知道是什么问题?