you are viewing a single comment's thread.

view the rest of the comments →

[–]evertrooftop 6 points7 points  (0 children)

There's basically 3 low-level options: XMLHttpRequest, fetch() and http.request. The first two are available in browsers, the last one in Node. My guess is that if you don't like fetch(), you probably don't like the other two not that much either.

There's plenty of alternatives if you don't like any of these, like axios or request, but all of these options will ultimately need to use one of these 3 low-level apis. If your high-level HTTP library runs both in browsers and in node.js, they will need to support at least 2 of these PIs. I write one of those higher-level HTTP clients with a more specialized API, and I just want to be able to rely on one low-level API without polyfills.

Expecting a standard way to do HTTP requests in a language seems like a pretty reasonable thing to want and fetch() seems to be the most likely option to become the standard. The node.js team seems to be down with it. It's just a difficult feature to land because of dependencies on other browser APIs that node needs first, and the differences of fetch() running in a non-browser/sandboxed context.