MCPcopy Create free account
hub / github.com/Semporia/Scripts / get

Method get

jd_api_test.js:289–312  ·  view source on GitHub ↗
(t, e = (() => {
    }))

Source from the content-addressed store, hash-verified

287 }
288
289 get(t, e = (() => {
290 })) {
291 t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {"X-Surge-Skip-Scripting": !1})), $httpClient.get(t, (t, s, i) => {
292 !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
293 })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => {
294 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
295 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
296 }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
297 try {
298 if (t.headers["set-cookie"]) {
299 const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
300 s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
301 }
302 } catch (t) {
303 this.logErr(t)
304 }
305 }).then(t => {
306 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
307 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
308 }, t => {
309 const {message: s, response: i} = t;
310 e(s, i, i && i.body)
311 }))
312 }
313
314 post(t, e = (() => {
315 })) {

Callers 3

getRandomCodeFunction · 0.45
versionFunction · 0.45
getScriptMethod · 0.45

Calls 7

eFunction · 0.70
isSurgeMethod · 0.45
isLoonMethod · 0.45
isQuanXMethod · 0.45
isNodeMethod · 0.45
initGotEnvMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected