MCPcopy Index your code
hub / github.com/Moli-X/Resources / httpPost

Function httpPost

Script/ZsHc.js:59–75  ·  view source on GitHub ↗
(url, headers, body)

Source from the content-addressed store, hash-verified

57}
58
59function httpPost(url, headers, body) {
60 if (isLoon || isSurge) {
61 return new Promise((resolve, reject) => {
62 $httpClient.post({ url, headers, body }, (err, resp, data) => {
63 if (err) reject(err);
64 else resolve({ status: resp.status, headers: resp.headers, body: data });
65 });
66 });
67 }
68 if (isQX) {
69 return $task.fetch({ url, method: "POST", headers, body }).then(resp => ({
70 status: resp.statusCode,
71 headers: resp.headers,
72 body: resp.body
73 }));
74 }
75}
76
77if (typeof $request !== "undefined") {
78 // 捕获 Cookie 和 xAuthorization

Callers 1

ZsHc.jsFile · 0.85

Calls 2

postMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…