sandbox中的优步apis 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请求库用于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)发布于 2015-04-15 06:35:12
uber的沙箱url是:- https://sandbox-api.uber.com/v1/requests
https://stackoverflow.com/questions/29409766
复制相似问题