MCPcopy
hub / github.com/axios/axios / respondWith

Method respondWith

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected