This module provides a function that creates a request engine based on the XMLHttpRequest API. Mind, this API is developed to work in a browser — node.js support only for tests.
AbortController
total
loaded
data
import xhrEngine from 'core/request/engines/xhr';const req = req('/search', {engine: xhrEngine}).then(({response}) => { console.log(response.decode());});req.emitter.on('progress', () => { // ..});req.emitter.on('upload.progress', () => { // ..});
Creates request by using XMLHttpRequest with the specified parameters and returns a promise
core/request/engines/xhr
This module provides a function that creates a request engine based on the XMLHttpRequest API. Mind, this API is developed to work in a browser — node.js support only for tests.
Synopsis
AbortController
.total
/loaded
fields withoutdata
).Example