| 2418 | t && ((t.headers = t.headers ? t.headers : {}), void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)); |
| 2419 | } |
| 2420 | get(t, s = () => {}) { |
| 2421 | t.headers && (delete t.headers['Content-Type'], delete t.headers['Content-Length']), |
| 2422 | this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => { |
| 2423 | !t && e && ((e.body = i), (e.statusCode = e.status)), |
| 2424 | s(t, e, i); |
| 2425 | }) : this.isQuanX() ? $task.fetch(t).then((t) => { |
| 2426 | const { |
| 2427 | statusCode: e, |
| 2428 | statusCode: i, |
| 2429 | headers: o, |
| 2430 | body: h |
| 2431 | } = t; |
| 2432 | s(null, { |
| 2433 | status: e, |
| 2434 | statusCode: i, |
| 2435 | headers: o, |
| 2436 | body: h |
| 2437 | }, h); |
| 2438 | }, (t) => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on('redirect', (t, s) => { |
| 2439 | try { |
| 2440 | const e = t.headers['set-cookie'].map(this.cktough.Cookie.parse).toString(); |
| 2441 | this.ckjar.setCookieSync(e, null), |
| 2442 | (s.cookieJar = this.ckjar); |
| 2443 | } catch (t) { |
| 2444 | this.logErr(t); |
| 2445 | } |
| 2446 | }).then((t) => { |
| 2447 | const { |
| 2448 | statusCode: e, |
| 2449 | statusCode: i, |
| 2450 | headers: o, |
| 2451 | body: h |
| 2452 | } = t; |
| 2453 | s(null, { |
| 2454 | status: e, |
| 2455 | statusCode: i, |
| 2456 | headers: o, |
| 2457 | body: h |
| 2458 | }, h); |
| 2459 | }, (t) => s(t))); |
| 2460 | } |
| 2461 | post(t, s = () => {}) { |
| 2462 | if ((t.body && t.headers && !t.headers['Content-Type'] && (t.headers['Content-Type'] = 'application/x-www-form-urlencoded'), delete t.headers['Content-Length'], this.isSurge() || this.isLoon())) |
| 2463 | $httpClient.post(t, (t, e, i) => { |