MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / dispatchRequest

Method dispatchRequest

daily/ydyp.js:3287–3320  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

3285 return "function" == typeof e.fetch ? e.fetch : "function" == typeof this.defaults.fetch ? this.defaults.fetch : null
3286 }
3287 dispatchRequest(t) {
3288 const r = this.resolveAdapter(t);
3289 if (!r) return Promise.reject(new e("No available adapter", "ERR_NOT_SUPPORT", t));
3290 const o = function(e) {
3291 const t = u(e);
3292 return {
3293 url: t.url,
3294 method: t.method,
3295 headers: t.headers,
3296 body: t.body,
3297 bodyBytes: t.bodyBytes,
3298 timeout: t.timeout,
3299 policy: t.policy,
3300 redirection: t.redirection,
3301 "auto-redirect": t["auto-redirect"],
3302 "auto-cookie": t["auto-cookie"],
3303 opts: t.opts,
3304 "binary-mode": t["binary-mode"],
3305 data: t.data
3306 }
3307 }(t);
3308 return Promise.resolve(r(o, t)).then(function(r) {
3309 const o = h(r) ? r : l(r, t, r && r.request);
3310 if (!o.ok && !1 !== t.throwHttpErrors) throw new e("Request failed with status code " + o.status, "ERR_BAD_RESPONSE", t, o.request, o);
3311 return o
3312 }, function(r) {
3313 throw function(t, r) {
3314 if (t && t.isAxiosError) return t;
3315 let o = t && t.request,
3316 n = t && t.response;
3317 return n && !h(n) && (n = l(n, r, n.request || o), o = n.request), !n && t && "object" == typeof t && ("status" in t || "statusCode" in t || "body" in t || "bodyBytes" in t || "data" in t ? n = l(t, r, o) : t.response && "object" == typeof t.response && (n = l(t.response, r, t.response.request || o), o = n.request)), new e(t && t.message || (n && n.status ? "Request failed with status code " + n.status : null) || String(t || "Network Error"), t && t.code || (n && n.status ? "ERR_BAD_RESPONSE" : "ERR_NETWORK"), r, o, n)
3318 }(r, t)
3319 })
3320 }
3321 mergeConfig(e) {
3322 const t = "string" == typeof e ? {
3323 url: e

Callers

nothing calls this directly

Calls 5

resolveAdapterMethod · 0.95
uFunction · 0.85
rFunction · 0.70
hFunction · 0.70
lFunction · 0.70

Tested by

no test coverage detected