为什么我对Google Directions API的HTTP请求无效?
下面是我的HTTP请求的URL:
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)®ion=uk&sensor=false
JSON响应如下:
{
"routes" : [],
"status" : "INVALID_REQUEST"
}
Google Directions API https://developers.google.com/maps/documentation/directions/#DirectionsRequests
答案 0 :(得分:4)
您拼错了目的地,可能错误地编码了您的坐标。尝试:
http://maps.googleapis.com/maps/api/directions/json?origin=50.8441144,-0.1094412&destination=50.861796,-0.083256®ion=uk&sensor=false
答案 1 :(得分:0)
您在请求网址中输了一个拼写错误:
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&desination=(50.861796,-0.083256)®ion=uk&sensor=false
应该是:
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&destination=(50.861796,-0.083256)®ion=uk&sensor=false
注意:des * t * ination。