Uber API doesn't allow request from localhost

久未见 提交于 2019-12-23 23:03:54

问题


When I use the Uber API, with localhost I receive the following error:

... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

So maybe I made an error. To test, I tried the url in Postman, but everything works as expected; I receive the expected JSON data. I also tried with curl. It works as expected.

I am sending my server token and I've adjusted my headers. No luck.

Previous SO answers hinted at this quote: "The Uber API implements the OAuth 2.0 standard for secure authentication and authorization. All communication with our servers must be over SSL (https://)."

Does this mean I have to use https:// ? I haven't had issues with any other APIs before this.


回答1:


Yes you need to use https. Some apis require it, others will take either depending on the receiving application.



来源:https://stackoverflow.com/questions/36269501/uber-api-doesnt-allow-request-from-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!