4 ms·
> it's based on the old XMLHttpRequest API rather than the more modern, and much better in my opinion, fetch() API. I fail to see what is wrong about it.
by rat9988 6y ago
> it's based on the old XMLHttpRequest API rather than the more modern, and much better in my opinion, fetch() API.
I fail to see what is wrong about it.
- onion2k 6y agoXMLHttpRequest is callback based and has an interesting API. fetch was written to be a sensible replacement. It does nice things like supporting promises by default and handling request cancellation.
- lhorie 6y agoXHR and fetch were in a "old thing is deprecated, new thing is not ready" sort of state for the longest time. XHR always supported aborting requests, along with progress callbacks. Also, IE11 doesn't support fetch, so you'd need to bring in a polyfill for it and for Promise there. (And FormData, and Blob and etc, if we're talking full spec compliance) Considering this history, I wouldn't dismiss an XHR-based implementation so fast.