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

Method respondWith

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

Source from the content-addressed store, hash-verified

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

Callers 1

finishRequestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected