Uber api requests
沙箱中的端点给出的响应为:
u'<html><title>404: Not Found</title><body>404: Not Found</body></html>'
。
对于沙箱,我使用端点:
https://sandbox-api.uber.com/v1/sandbox/requests
如果我使用 uber prod 端点,相同的请求可以正常工作
https://api.uber.com/v1/requests
我使用 python requests lib 作为 api:
import request
params = {'start_longitude': 'xx.xxxxxx', 'end_longitude': 'xx.xxxxxx',
'start_latitude': 'xx.xxxxxx', 'end_latitude': 'xx.xxxxxx',
'product_id': '0dfc35e0-b4be-49a1-b1bf-0bc7217e4b58'}
header = {'Content-Type': 'application/json',
'Authorization': 'Bearer xxx-acces-token-xxx'`}
res = requests.post('https://sandbox-api.uber.com/v1/sandbox/requests',
data=json.dumps(params), headers=headers)
就像我说的,如果我将 url 更改为 uber prod 环境,这项工作就会起作用:
res = requests.post('https://api.uber.com/v1/requests',
data=json.dumps(params), headers=headers)
最佳答案
uber api 的沙箱 URL 是:-
https://sandbox-api.uber.com/v1/requests
关于python - 对于 uber-api 沙箱环境,端点请求返回 404 not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29409766/