5 ms·
Node.js modules you should know about: request
- IsaacSchlueter 15y agoRequest is really quite nice. It's the simple high-level counterpart to node's low-level HTTP client. Very useful "sweet spot" in the abstraction levels.
- pkrumins 15y agoI like how SubStack put it - request is the swiss army knife of HTTP streaming.
- viscanti 15y agoThis is one of the modules everyone starts to build themselves, then realizes there's a much better version already built.
- tmcw 15y agoUnfortunately I've had the opposite experience: trying to use request then finding that I have to build my own. Mainly because it has no good pattern for both streaming and catching errors in a predictable fashion, the streaming isn't true streaming in most cases (try a 5GB file), and with binary files, it's tricky to nail the right encoding.
- hopeless 15y agoI agree about the encoding problems, particularly when using buffers. No combination seemed to allow me to download a binary file and then upload. But this was my first few hours with Node so I'm open to correction. In the end I was able to use .pipe which correctly managed the encoding
- tmcw 15y agoJust to clarify: the sorts of things I'm using an HTTP Get-type library for are atypical and request is fantastic for 95% percentage of uses. And the library I wrote ( https://github.com/developmentseed/node-get https://github.com/developmentseed/node-get ) isn't recommended for use if you aren't me. Though it does a decent job of staying out of your way.
- DanielRibeiro 15y agoNice nodejs version of Python's Request[1] and/or Ruby's Farday[2] [1] http://docs.python-requests.org/en/latest/index.html http://docs.python-requests.org/en/latest/index.html [2] https://github.com/technoweenie/faraday https://github.com/technoweenie/faraday
- llz 15y agoThis is great, can't wait to start replacing old code! No more complicated multi-line monster requests+callbacks.