cURL equivalent in Node.js?

slifty picture slifty · Jul 25, 2011 · Viewed 231.1k times · Source

I'm looking to use information from an HTTP request using Node.js (i.e. call a remote web service and echo the response to the client).

In PHP I would have used cURL to do this. What is the best practice in Node?

Answer

Dan Grossman picture Dan Grossman · Jul 25, 2011

See the documentation for the HTTP module for a full example:

https://nodejs.org/api/http.html#http_http_request_options_callback