To use Fetch in Firefox (38), you'll currently need to enable it — go to about:config, set dom.fetch.enabled to true, and restart the browser.
To use Fetch in Chrome 41/Opera 28, you need to enable the "Experimental Web Platform Features" pref in chrome://flags.
Yep, had a play around with fetch but it didn't seem ready and acted kind of weird. Can't remember exactly what was wrong as it was a while ago.
I imagine once fetch is decent, most libraries like this won't be hugely useful, but in the mean time, something like xr is a nice way to have a very tiny dependency that makes making AJAX requests just that little bit nicer.
While I was a little sad about the API too, what would you propose that's better? Connection-less network IO seems like it'd very easily devolve to a "giant options object", and this lets you at least incrementally build that options object on the path from your code to this API.
Hello, author here. I thought I'd make this because I couldn't find a library that was tiny, and opinionated about using promises and sane defaults (JSON headers, for instance), and exposed the bits of XMLHttpRequest that I wanted. It actually does very little, but provides some nice little helpers to do AJAX requests. Everything is override-able. I'm toying with even making the basic Object.assign and Promise calls injectable too (see this branch: https://github.com/radiosilence/xr/blob/compat/src/xr.js) but it makes the code a bit uglier.
The other handy feature is that it will use whichever Promise library that's available in the global namespace, so as long as that conforms to the spec, it will happily work with it.
Also, title should be lower case, as with most node modules.
Haven't seen it, no. Looks neat, but a bit more complex than what I was going for. This is basically a nicer interface to XHR, intended for people who are happy to read up on the XHR API and use that for anything more complicated.
XHR (XML HTTP Request) always seemed like a sadly particular API name for something that's rarely used to consume XML. From that point-of-view, HR seems like a better name than XR. ;-)
Polyfill: https://github.com/github/fetch
To use Fetch in Firefox (38), you'll currently need to enable it — go to about:config, set dom.fetch.enabled to true, and restart the browser. To use Fetch in Chrome 41/Opera 28, you need to enable the "Experimental Web Platform Features" pref in chrome://flags.