MCPcopy Create free account
hub / github.com/Semporia/Scripts / post

Function post

JD_DailyBonus.js:1888–1928  ·  view source on GitHub ↗
(options, callback)

Source from the content-addressed store, hash-verified

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'
1891 if (isQuanX) {
1892 if (typeof options == "string") options = {
1893 url: options
1894 }
1895 options["method"] = "POST"
1896 //options["opts"] = {
1897 // "hints": false
1898 //}
1899 $task.fetch(options).then(response => {
1900 callback(null, adapterStatus(response), response.body)
1901 }, reason => callback(reason.error, null, null))
1902 }
1903 if (isSurge) {
1904 options.headers['X-Surge-Skip-Scripting'] = false
1905 $httpClient.post(options, (error, response, body) => {
1906 callback(error, adapterStatus(response), body)
1907 })
1908 }
1909 if (isNode) {
1910 node.request.post(options, (error, response, body) => {
1911 callback(error, adapterStatus(response), body)
1912 })
1913 }
1914 if (isJSBox) {
1915 if (typeof options == "string") options = {
1916 url: options
1917 }
1918 options["header"] = options["headers"]
1919 options["handler"] = function(resp) {
1920 let error = resp.error;
1921 if (error) error = JSON.stringify(resp.error)
1922 let body = resp.data;
1923 if (typeof body == "object") body = JSON.stringify(resp.data)
1924 callback(error, adapterStatus(resp.response), body)
1925 }
1926 $http.post(options);
1927 }
1928 }
1929 const AnError = (name, keyname, er, resp, body) => {
1930 if (typeof(merge) != "undefined" && keyname) {
1931 if (!merge[keyname].notify) {

Callers

nothing calls this directly

Calls 3

callbackFunction · 0.85
adapterStatusFunction · 0.85
postMethod · 0.45

Tested by

no test coverage detected