Reputation: 71
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)®ion=uk&sensor=false
The JSON response is as follows:
{
"routes" : [],
"status" : "INVALID_REQUEST"
}
Google Directions API https://developers.google.com/maps/documentation/directions/#DirectionsRequests
Upvotes: 0
Views: 686
Reputation: 45493
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)®ion=uk&sensor=false
Should be:
http://maps.googleapis.com/maps/api/directions/json?origin=(50.8441144,-0.1094412)&destination=(50.861796,-0.083256)®ion=uk&sensor=false
Note: des*t*ination.
Upvotes: 0
Reputation: 22904
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®ion=uk&sensor=false
Upvotes: 4