How should querying a JSON API be done best in node.js? Is there a module that will simplify this?
I am trying to get the City location from http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452
I would use jQuery to query the API in client-side because it vastly simplifies things. Is there something similar for node.js?
The request
module makes http-request very easy. Just place a GET request to your URL and JSON.parse()
the response. You might want to use encodeURIComponent()
for your query parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With