TypeError: cannot convert Net :: HTTPOK to string

I use net/httpand jsonto geocode addresses using the Google Geocoding API. An error is thrown here:

response = Net::HTTP.get_response(URI.parse(url))
result = JSON.parse(response)

The response is from the Net :: HTTPOK class, but I want to access the actual JSON response data (and not just the status code).

+5
source share
1 answer
+20
source

All Articles