MCPcopy Create free account
hub / github.com/axios/axios / respondWith

Method respondWith

tests/browser/basicAuth.browser.test.js:42–57  ·  view source on GitHub ↗
({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {})

Source from the content-addressed store, hash-verified

40 }
41
42 respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {
43 this.status = status;
44 this.statusText = statusText;
45 this.responseText = responseText;
46 this.response = responseText;
47 this.responseHeaders = responseHeaders;
48 this.readyState = 4;
49
50 queueMicrotask(() => {
51 if (this.onloadend) {
52 this.onloadend();
53 } else if (this.onreadystatechange) {
54 this.onreadystatechange();
55 }
56 });
57 }
58
59 abort() {}
60}

Callers 1

flushSuccessFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected