Google Geocoding service returns Error 400 Bad Request
I've been trying to get a json response from google's geocoding service. I'm using PHP. I was trying with fopen, then I read in another stackoverflow question that I should use file_get_contents, but didn't worked too. Then I keep searching and found someone in another forum who said I would a better solution if I use CURL so I changed my code and is not working. In all cases I received an "Error 400: Bad Request. Your client has issued a malformed or illegal request." My code is this: $jsonUrl = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $cityName . "&sensor=false";