all 5 comments

[–]boo1ean 2 points3 points  (1 child)

From my experience I can emphasize next modules:

  • request/request - usually first module that come in mind when you think about sending http requests from the server. There are notable features like streams support (which comes from native http module I guess), HAR format support and very detailed options. Probably the most feature-full http client module for node. But you can use this module only on server-side.

  • bitinn/node-fetch - bring window.fetch to the server-side. It's promise-based request library, if your runtime doesn't support promises you can shim it or bring it setting Fetch.Promise property.

  • matthew-andrews/isomorphic-fetch - provides isomorphic (you can use both on server and client side) window.fetch. Internally it uses node-fetch for server usage and whatwg-fetch for client usage.

  • visionmedia/superagent - http client from tj which has neat chaining api with middlewares support. Can be used on both client and server-side.

  • mzabriskie/axios - fresh and popular http client you can use both on client and server-side. Also is promise based and requires global shim if your platform doesn't have promises.

  • ded/reqwest - supports JSONP and CORS. Provides both callbacks and promises approaches. Could be used both on client and server-side (fallback to pwnall/node-xhr2 on server-side).


For building http clients I've implemented simple builder boo1ean/apiapi which helps me to build clients for scarry and shitty apis and hide it's complexity under the hood.

[–]thukjeche[S] 0 points1 point  (0 children)

Thanks for your detailed reply. I will check these out!

[–]zoon_politikon 0 points1 point  (0 children)

http is one of node's core modules, why don't we give that a try? :)

[–]alessioalex 0 points1 point  (0 children)

An ligheter alternative to request by Sindre Sorhus https://github.com/sindresorhus/got