找不到 uber-api 沙箱环境的端点请求 returns 404
Endpoint requests returns 404 not found for uber-api sandbox environment
Uber 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
我为 api 使用了 python 请求库:
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)
优步 api 的沙盒 url 是:-
https://sandbox-api.uber.com/v1/requests
Uber 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
我为 api 使用了 python 请求库:
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)
优步 api 的沙盒 url 是:-
https://sandbox-api.uber.com/v1/requests