端点请求返回未找到的uber-api沙箱环境404

时间:2015-04-02 09:43:09

标签: python uber-api

沙箱中的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请求lib:

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)

1 个答案:

答案 0 :(得分:3)

uber api的沙箱网址是: -  https://sandbox-api.uber.com/v1/requests