且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google地理编码API - REQUEST_DENIED

更新时间:2023-01-03 20:34:39

截至2014年底,此错误的常见来源是省略请求中的强制传感器参数,如下所示。但是截至2014年12月31日或更早的时间,不再需要:


传感器参数

以前的Google Maps API要求您包含传感器参数以指示您的应用程序是否使用传感器来确定用户的位置。







您是否指定了传感器参数请求?


REQUEST_DENIED表示您的请求被拒绝,通常是因为缺乏传感器参数。

传感器(必需) - 表示地理编码请求是否来自具有位置传感器的设备。此值必须为true或false


Apparently I do not need a 'Maps API key' to use the 'Google Geocoding API' according to:

http://code.google.com/apis/maps/documentation/geocoding/index.html

However, I obtain this:

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

Does this mean that my IP is blocked? What can I do to overcome this? Thanks.

Christian

Until the end of 2014, a common source of this error was omitting the mandatory sensor parameter from the request, as below. However as of 2014/12/31 or earlier that is no longer required:

The sensor Parameter

The Google Maps API previously required that you include the sensor parameter to indicate whether your application used a sensor to determine the user's location. This parameter is no longer required.


Did you specify the sensor parameter on the request?

"REQUEST_DENIED" indicates that your request was denied, generally because of lack of a sensor parameter.

sensor (required) — Indicates whether or not the geocoding request comes from a device with a location sensor. This value must be either true or false