(t, e = (() => {
}))
| 1023 | } |
| 1024 | |
| 1025 | post(t, e = (() => { |
| 1026 | })) { |
| 1027 | 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) => { |
| 1028 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) |
| 1029 | }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => { |
| 1030 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1031 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1032 | }, t => e(t)); else if (this.isNode()) { |
| 1033 | this.initGotEnv(t); |
| 1034 | const {url: s, ...i} = t; |
| 1035 | this.got.post(s, i).then(t => { |
| 1036 | const {statusCode: s, statusCode: i, headers: r, body: o} = t; |
| 1037 | e(null, {status: s, statusCode: i, headers: r, body: o}, o) |
| 1038 | }, t => { |
| 1039 | const {message: s, response: i} = t; |
| 1040 | e(s, i, i && i.body) |
| 1041 | }) |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | time(t, e = null) { |
| 1046 | const s = e ? new Date(e) : new Date; |
no test coverage detected