The following (and other similar) HTTP request to the Google geocoding API comes out correctly when I paste it into my browser
http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
And when I do the following in Ruby
url = URI.parse('http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
puts res.body
I get
{
"results" : [],
"status" : "REQUEST_DENIED"
}
This is the same error I get when not setting the "sensor" property for example, but that's not the problem.
Any suggestions?