无法从localhost访问uber api

时间:2017-06-05 20:47:50

标签: uber-api

我在我的仪表板上设置了localhost但是 我收到此错误的原因是不允许它:

XMLHttpRequest无法加载https://api.uber.com/v1.2/estimates/price?start_latitude=37.7752315&start_longitude=-122.418075&end_latitude=37.7752415&end_longitude=-122.518075 ....请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许原点“http://localhost:8080”访问。

1 个答案:

答案 0 :(得分:1)

I believe you're running an unsecured local server. Any API call to the Uber API should use TSL (HTTPS). Based on your error message, you seem to make calls from http://. Could you try to enable TSL in your local server configuration and try again?

You can also take a look at this answer here: Uber API doesn't allow request from localhost