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

Method respondWith

tests/browser/interceptors.browser.test.js:55–72  ·  view source on GitHub ↗
({
    status = 200,
    statusText = 'OK',
    responseText = '',
    response = null,
    responseHeaders = {},
    headers = {},
    responseURL = '',
  } = {})

Source from the content-addressed store, hash-verified

53 }
54
55 respondWith({
56 status = 200,
57 statusText = 'OK',
58 responseText = '',
59 response = null,
60 responseHeaders = {},
61 headers = {},
62 responseURL = '',
63 } = {}) {
64 this.status = status;
65 this.statusText = statusText;
66 this.responseText = responseText;
67 this.response = response === null ? responseText : response;
68 this.responseHeaders = Object.keys(headers).length ? headers : responseHeaders;
69 this.responseURL = responseURL;
70 this.readyState = 4;
71 this.finish();
72 }
73
74 responseTimeout() {
75 if (this.ontimeout) {

Callers 3

fireRequestFunction · 0.45
fireRequestCatchFunction · 0.45

Calls 1

finishMethod · 0.95

Tested by

no test coverage detected