MCPcopy Create free account
hub / github.com/Moli-X/Resources / post

Function post

Script/JD/JdPrice.js:273–291  ·  view source on GitHub ↗
(options, callback)

Source from the content-addressed store, hash-verified

271 }
272 }
273 const post = (options, callback) => {
274 if (isQuanX) {
275 if (typeof options == "string") options = { url: options }
276 options["method"] = "POST"
277 $task.fetch(options).then(response => {
278 callback(null, adapterStatus(response), response.body)
279 }, reason => callback(reason.error, null, null))
280 }
281 if (isSurge) {
282 $httpClient.post(options, (error, response, body) => {
283 callback(error, adapterStatus(response), body)
284 })
285 }
286 if (node) {
287 node.request.post(options, (error, response, body) => {
288 callback(error, adapterStatus(response), body)
289 })
290 }
291 }
292 return { isQuanX, isSurge, isResponse, notify, write, read, get, post }
293}
294

Callers

nothing calls this directly

Calls 3

adapterStatusFunction · 0.70
fetchMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected