MCPcopy Index your code
hub / github.com/NobyDa/Script / get

Function get

JD-DailyBonus/JD_DailyBonus.js:1856–1895  ·  view source on GitHub ↗
(options, callback)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

adapterStatusFunction · 0.70
getMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected