Can not make a request to google map
Posted
by
Eme Emertana
on Stack Overflow
See other posts from Stack Overflow
or by Eme Emertana
Published on 2012-09-26T08:42:13Z
Indexed on
2012/09/26
9:38 UTC
Read the original article
Hit count: 181
google-maps
|google-maps-api-3
Hi I am making a restful request to google map, but I run into following error;
java.io.IOException: Server returned HTTP response code: 400 for URL:
http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Washington, DC
USA&destinations=Los+Angeles+CA+USA&mode=driving&sensor=false
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at java.net.URLConnection.getContent(URLConnection.java:688)
I believe its making a correct connection as I can get the correct response by copying the above URL into my browser, I am wondering why I am getting 400 error code in my console and I dont get the correct response when java is sending the request.
© Stack Overflow or respective owner