I am working on play framework 2.1.1 (java) and googlemap v3 (local website).
I want to get latitude and longitude using googlemap url. I want this url return me json response to parse it later and insert lat and long in my database. It works fine when it's not a googlemap url but i have the famous "request_denied" error when I use this kind of url in my code:
http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false
I don't know why, I read this error come from the lack of the sensor parameter but as you can see it's in my url.
About my code :
public static Result displaySomeJson(){
Promise<WS.Response> request= WS.url("http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false").get();
JsonNode json = request.asJson();
return ok(json.toString())
}
it gives me : {"results" : [],"status" : "REQUEST_DENIED"}
- I also tried with http ://maps.GOOGLE.com instead of http ://maps.GOOGLEAPIS.com but i got the same result.
- I also tried using an api key but it failed again.
- I didn't send to much request.
If you have any suggestion, please share.