python - 对于 uber-api 沙箱环境,端点请求返回 404 not found

标签 python uber-api

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/

相关文章:

android - 无法在服务器端使用 Uber 刷新 token 重新生成 Uber 访问 token

python - 将 2 级索引添加为其他有条件的索引的总和

python - 无法通过 Python SDK 使用 BigQuery 运行多个更新

Android uber 错误 No authentication challenges found

ios - 请求 Uber real ride with surge confirmation 时收到 409 unknown error 的响应

ios - 如何对优步供应商进行分类?

python - 对在 GAE 上托管 OSQA/Django 的担忧

python - ConvexHull 检测矩形(四边形)

python - 从超像素段获取box2d

ios - 即使安装了 Uber 应用程序,Uber API 也会在 iOs 上打开 Ride Request Widget。