Google Place API - Always return this “status” : “REQUEST_DENIED”

混江龙づ霸主 提交于 2019-12-01 05:49:17

You are using http(s) for calling Google API, is your html also hosted under http(s). If not try changing google url to http.

Otherwise every thing else kinda looks ok so that makes me think you might wanna check your api console again, go to SERVICES and check if your 'Places API' is turned ON.

You can also try changing the Port address to 443 to get response from Places API

The "status": "REQUEST_DENIED" is returned by the Places API when:

You have not activated the Places API Service in the services tab of the APIs console.
The sensor parameter is missing from your request, or is set to something other than true or false.
The key parameter is missing from your request.
The key parameter does not match the your API key in the API Access tab of the APIs console.
Your API key has not been correctly set up in the API Access tab of the APIs Console:
    If you are using a Browser key, check that your allowed Referer(s) are correct.
    If you are using a Server key, check that your allowed IP(s) are correct.
    Android and iOS keys are not supported, please use a Browser or Server key.
The request was not sent as an HTTPS request, HTTPS is required for all Web Service requests.
The incorrect HTTP method was used to send the request:
    All requests must be sent as a GET request except for Place Actions.
    All Place Actions must be sent as a POST request.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!