Last Updated: September 09, 2019
·
2.26K
· twilson63

request - http request module

https://github.com/mikeal/request

stream http responses to files:

request('http://google.com/doodle.png')
  .pipe(fs.createWriteStream('doodle.png'));

or just use as a http client, with callbacks

request.post('http://localhost:5984/foo', { json: { foo: 'bar' }, function(err, res, body) {
  console.log(body);
});

3 Responses
Add your response

thanks

over 1 year ago ·

What's the benefit compared to using node.js http?

over 1 year ago ·

Lots of things:

  • Simple API
  • Streaming Support
  • Multipart Form Support
  • OAUTH Signing Support
  • AWS Signing Support
  • Cookie Jar Support
  • defaults - See the Github Page for more details

https://github.com/mikeal/request

over 1 year ago ·