(options, callback)
| 1846 | return response |
| 1847 | } |
| 1848 | const get = (options, callback) => { |
| 1849 | options.headers['User-Agent'] = 'JD4iPhone/167169 (iPhone; iOS 13.4.1; Scale/3.00)' |
| 1850 | if (isQuanX) { |
| 1851 | if (typeof options == "string") options = { |
| 1852 | url: options |
| 1853 | } |
| 1854 | options["method"] = "GET" |
| 1855 | //options["opts"] = { |
| 1856 | // "hints": false |
| 1857 | //} |
| 1858 | $task.fetch(options).then(response => { |
| 1859 | callback(null, adapterStatus(response), response.body) |
| 1860 | }, reason => callback(reason.error, null, null)) |
| 1861 | } |
| 1862 | if (isSurge) { |
| 1863 | options.headers['X-Surge-Skip-Scripting'] = false |
| 1864 | $httpClient.get(options, (error, response, body) => { |
| 1865 | callback(error, adapterStatus(response), body) |
| 1866 | }) |
| 1867 | } |
| 1868 | if (isNode) { |
| 1869 | node.request(options, (error, response, body) => { |
| 1870 | callback(error, adapterStatus(response), body) |
| 1871 | }) |
| 1872 | } |
| 1873 | if (isJSBox) { |
| 1874 | if (typeof options == "string") options = { |
| 1875 | url: options |
| 1876 | } |
| 1877 | options["header"] = options["headers"] |
| 1878 | options["handler"] = function(resp) { |
| 1879 | let error = resp.error; |
| 1880 | if (error) error = JSON.stringify(resp.error) |
| 1881 | let body = resp.data; |
| 1882 | if (typeof body == "object") body = JSON.stringify(resp.data); |
| 1883 | callback(error, adapterStatus(resp.response), body) |
| 1884 | }; |
| 1885 | $http.get(options); |
| 1886 | } |
| 1887 | } |
| 1888 | const post = (options, callback) => { |
| 1889 | options.headers['User-Agent'] = 'JD4iPhone/167169 (iPhone; iOS 13.4.1; Scale/3.00)' |
| 1890 | if (options.body) options.headers['Content-Type'] = 'application/x-www-form-urlencoded' |
nothing calls this directly
no test coverage detected