您好,我正在尝试在我的项目中实现乘车提醒 Uber API,但我收到了如下错误响应:
引用网址:
https://developer.uber.com/docs/v1-reminders-post
JSON 错误响应:
{
"message": "Unable to parse JSON in request body.",
"code": "invalid_json"
}
网址
https://api.uber.com/v1/reminders
标题:
Content-Type: application/json
Authorization: Token vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr
发布参数:
reminder_time:1451496600(Unix UTC timestamp of when the reminder will occur.)
phone_number: +91xxxxxxxxxx(India's number)
server_token: vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr
event: {
"time": "1451498400",
"longitude": "72.5290",
"latitude": "23.0384",
"location": "Vastrapurlake",
"name": "Test"
}
更多细节请查看 PostMan 屏幕截图:
帖子参数:Click here header 参数:Click here
您能帮我一下吗,先谢谢了!!
最佳答案
您的内容类型和 token 是有效的,不要更改任何内容。
只需将参数转换为 json,不要忘记使用双引号。
您必须在 postman 中以 json 格式传递这些数据。
{"reminder_time":"1451649600",
"phone_number": "+91<YOUR-MOBILE-NUMBER>",
"server_token": "vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr",
"event": {
"time": "1451649600",
"longitude": "72.5290",
"latitude": "23.0384",
"location": "Vastrapurlake",
"name": "Test"
}}
关于uber-api - 乘车提醒 Uber Api 出现 JSON 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34553683/