我正在尝试使用Postman来解决我收到的API错误。我使用OAuth进行身份验证,所以我发布了标题和表单数据。然而,我的错误似乎与表单数据有关。我还尝试将“Content-Type”设置为“application/json;charset=utf-8”,但没有。同样的结果。
{
"error": "795: unexpected token at '------WebKitFormBoundaryoRBw9tLdltLHfrtU\r\nContent- Disposition: form-data; name=\"topic\"\r\n\r\ncheckouts/update\r\n------WebKitFormBoundaryoRBw9tLdltLHfrtU\r\nContent-Disposition: form-data; name=\"address\"\r\n\r\nhttps://mysite.co/checkout/\r\n------WebKitFormBoundaryoRBw9tLdltLHfrtU\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\njson\r\n------WebKitFormBoundaryoRBw9tLdltLHfrtU--\r\n'"
}我认为Postman在API能够正确读取我的数据之前就对它进行了转义。有什么办法让Postman停止过早地泄露我的数据吗?这上面似乎没有问题。
请求正文:
"webhook":[{"topic": "checkouts/update","address": "https://mysite.co/checkout","format": "json"}]发布于 2015-02-07 03:02:41
您需要将JSON属性封装在JSON对象中,这通常是API所期望的。
{
"webhook":[
{"topic": "checkouts/update","address": "https://mysite.co/checkout","format": "json"}
]
}https://stackoverflow.com/questions/28369896
复制相似问题