简体   繁体   English

无效(Google Directions API)

[英]Invalid(Google Directions API)

Why is my HTTP request to the Google Directions API invalid? 为什么我对Google Directions API的HTTP请求无效?

Below, is the URL of my HTTP request: 以下是我的HTTP请求的网址:

http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)&region=uk&sensor=false

The JSON response is as follows: JSON响应如下:

{
   "routes" : [],
   "status" : "INVALID_REQUEST"
}

Google Directions API https://developers.google.com/maps/documentation/directions/#DirectionsRequests Google Directions API https://developers.google.com/maps/documentation/directions/#DirectionsRequests

You misspelled destination and may have encoded your coordinates incorrectly. 您拼错了目的地,并且可能未正确编码您的坐标。 Try: 尝试:

http://maps.googleapis.com/maps/api/directions/json?origin=50.8441144,-0.1094412&destination=50.861796,-0.083256&region=uk&sensor=false

You made a typo in the request url: 您在请求网址中输入了错误:

http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)&region=uk&sensor=false

Should be: 应该:

http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&destination=(50.861796,-0.083256)&region=uk&sensor=false

Note: des* t *ination. 注意:des * t *方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM