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

Method post

jd_superMarket.js:2307–2325  ·  view source on GitHub ↗
(t, e = (() => {
    }))

Source from the content-addressed store, hash-verified

2305 }
2306
2307 post(t, e = (() => {
2308 })) {
2309 if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && 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.post(t, (t, s, i) => {
2310 !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
2311 }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => {
2312 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
2313 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
2314 }, t => e(t)); else if (this.isNode()) {
2315 this.initGotEnv(t);
2316 const {url: s, ...i} = t;
2317 this.got.post(s, i).then(t => {
2318 const {statusCode: s, statusCode: i, headers: r, body: o} = t;
2319 e(null, {status: s, statusCode: i, headers: r, body: o}, o)
2320 }, t => {
2321 const {message: s, response: i} = t;
2322 e(s, i, i && i.body)
2323 })
2324 }
2325 }
2326
2327 time(t, e = null) {
2328 const s = e ? new Date(e) : new Date;

Callers 2

runScriptMethod · 0.45
msgMethod · 0.45

Calls 6

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

Tested by

no test coverage detected