XMLHttpRequest, reimplemented using fetch.
node-fetch
.Due to the nature of fetch(),
progress
event.XMLHttpRequest.upload
.HEADERS_RECEIVED
and LOADING
ready states are skipped.Because this is still XMLHttpRequest,
node-fetch
.This does not support obsolete APIs such as:
XMLHttpRequest.onreadystatechange
XMLHttpRequest.open
(use Authorization header!)Due to the nature of the main usage,
XMLHttpRequest.responseXML
always throws.Document
cannot be used in XMLHttpRequest.send()
.text/plain
.ProgressEvent
, CustomEvent
is used.This shim assumes you have these ES features:
async
supportclass
syntaxglobalThis
Object.assign
Object.create
Object.entries
Promise
including Promise.prototype.finally
Symbol
And these WHATWG features:
AbortController
Blob
DOMException
EventTarget.prototype.addEventListener
with once
optionfetch
API with signal
supportsetTimeout