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

Method get

jd_joy_new.js:1149–1172  ·  view source on GitHub ↗
(t, e = (() => {
    }))

Source from the content-addressed store, hash-verified

1147 }
1148
1149 get(t, e = (() => {
1150 })) {
1151 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) => {
1152 !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
1153 })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => {
1154 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
1155 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
1156 }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
1157 try {
1158 if (t.headers["set-cookie"]) {
1159 const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
1160 s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
1161 }
1162 } catch (t) {
1163 this.logErr(t)
1164 }
1165 }).then(t => {
1166 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
1167 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
1168 }, t => {
1169 const {message: s, response: i} = t;
1170 e(s, i, i && i.body)
1171 }))
1172 }
1173
1174 post(t, e = (() => {
1175 })) {

Callers 9

jsonpMethod · 0.45
getFollowChannelsFunction · 0.45
taskListFunction · 0.45
beforeTaskFunction · 0.45
feedFunction · 0.45
awardFunction · 0.45
runFunction · 0.45
getFriendsFunction · 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