drupal_http_request times out on Google Maps geocoding URL When I navigate to http://maps.google.com/maps/api/geocode/json?address=1200+Amphitheatre+Parkway,+Mountain+View,+CA&amp;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&amp;sensor=false') return a timeout error?
You cannot directly include url queries in the url when using drupal_http_request(). Use url().

$url = url('http://maps.google.com/maps/api/geocode/json', ['query' =&gt; ['address'=&gt;'1200 Amphitheatre Parkway, Mountain View, CA', 'sensor'=&gt; FALSE]]);
drupal_http_request($url);