5

我目前正在使用 Google Place API,每当我要访问此链接时都会遇到问题

https://maps.googleapis.com/maps/api/place/search/json?location=latitude,longitude&radius=1&sensor=false&key=apikey

输入纬度,经度API密钥等信息并将传感器设置为false,但它始终显示:

{
   "debug_info" : [],
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
} 

我已经搜索过这种错误,我看到一些帖子建议检查传感器值并检查API 密钥。我已经检查过了,还检查了服务是否已启用Google Maps API v3。但没有什么对我有用。我是新手,我不明白我做错了什么,请帮助。

4

2 回答 2

8

您正在使用 http(s) 调用 Google API,您的 html 是否也托管在 http(s) 下。如果不尝试将 google url 更改为 http。

否则,其他一切看起来都还不错,所以我认为您可能想再次检查您的 api 控制台,转到 SERVICES 并检查您的“Places API”是否已打开。

您也可以尝试将端口地址更改为 443 以获取 Places API 的响应

于 2013-06-20T13:16:25.480 回答
0

“状态”:“REQUEST_DENIED”由 Places API 在以下情况下返回:

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.
于 2014-02-26T03:25:31.073 回答