When I navigate to http://maps.google.com/maps/api/geocode/json?address=1200+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
(the Google Maps Geocoding API test address) in my browser (Chrome), I get a json response as expected. However, when I drupal_http_request()
the same url, I get a request timeout error. I tried setting the timeout to 60 instead of 30 but it doesn't help.
Why does drupal_http_request('http://maps.google.com/maps/api/geocode/json?address=1200+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false')
return a timeout error?
file_get_contents('http://maps.google.com/maps/api/geocode/json?address=1200+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false')
? If that times out too the problem's probably environmental (network etc). It works fine from here usingdrupal_http_request
file_get_contents()
also timed out for me. Butdrupal_http_request('http://drupal.stackexchange.com')
doesn't time out, it works fine.