(options, callback)
| 465 | } |
| 466 | } |
| 467 | const post = (options, callback) => { |
| 468 | if (isQuanX) { |
| 469 | if (typeof options == "string") options = { |
| 470 | url: options |
| 471 | } |
| 472 | options["method"] = "POST" |
| 473 | $task.fetch(options).then(response => { |
| 474 | callback(null, adapterStatus(response), response.body) |
| 475 | }, reason => callback(reason.error, null, null)) |
| 476 | } |
| 477 | if (isSurge) { |
| 478 | options.headers['X-Surge-Skip-Scripting'] = false |
| 479 | $httpClient.post(options, (error, response, body) => { |
| 480 | callback(error, adapterStatus(response), body) |
| 481 | }) |
| 482 | } |
| 483 | if (isNode) { |
| 484 | node.request.post(options, (error, response, body) => { |
| 485 | callback(error, adapterStatus(response), body) |
| 486 | }) |
| 487 | } |
| 488 | if (isJSBox) { |
| 489 | if (typeof options == "string") options = { |
| 490 | url: options |
| 491 | } |
| 492 | options["header"] = options["headers"] |
| 493 | options["handler"] = function (resp) { |
| 494 | let error = resp.error; |
| 495 | if (error) error = JSON.stringify(resp.error) |
| 496 | let body = resp.data; |
| 497 | if (typeof body == "object") body = JSON.stringify(resp.data) |
| 498 | callback(error, adapterStatus(resp.response), body) |
| 499 | } |
| 500 | $http.post(options); |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | const log = (message) => console.log(message) |
| 505 | const time = () => { |
nothing calls this directly
no test coverage detected