Last Updated: September 09, 2019
·
2.485K
· 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 ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside