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 cUR
There is npm module to make a curl like request, npm curlrequest
.
Step 1: $npm i -S curlrequest
Step 2: In your node file
let curl = require('curlrequest')
let options = {} // url, method, data, timeout,data, etc can be passed as options
curl.request(options,(err,response)=>{
// err is the error returned from the api
// response contains the data returned from the api
})
For further reading and understanding, npm curlrequest