MCPcopy Create free account
hub / github.com/NobyDa/Script / post

Function post

BDTieBa-DailyBonus/TieBa.js:286–301  ·  view source on GitHub ↗
(options, callback)

Source from the content-addressed store, hash-verified

284 })
285 }
286 const post = (options, callback) => {
287 if (isQuanX) {
288 if (typeof options == "string") options = {
289 url: options
290 }
291 options["method"] = "POST"
292 $task.fetch(options).then(response => {
293 callback(null, adapterStatus(response), response.body)
294 }, reason => callback(reason.error, null, null))
295 }
296 if (isSurge) {
297 $httpClient.post(options, (error, response, body) => {
298 callback(error, adapterStatus(response), body)
299 })
300 }
301 }
302 const done = (value = {}) => {
303 if (isQuanX) return $done(value)
304 if (isSurge) isRequest ? $done(value) : $done()

Callers

nothing calls this directly

Calls 2

adapterStatusFunction · 0.70
postMethod · 0.45

Tested by

no test coverage detected