Pergunta

Why is my HTTP request to the Google Directions API invalid?

Below, is the URL of my HTTP request:

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:

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

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

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top