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

Function getPostRequest

jd_zoo.js:818–837  ·  view source on GitHub ↗
(type, body)

Source from the content-addressed store, hash-verified

816}
817
818async function getPostRequest(type, body) {
819 let url = `https://api.m.jd.com/client.action?functionId=${type}`;
820 if(type === 'listTask' || type === 'acceptTask' ){
821 url = `https://ms.jr.jd.com/gw/generic/hy/h5/m/${type}`;
822 }
823 const method = `POST`;
824 const headers = {
825 'Accept': `application/json, text/plain, */*`,
826 'Origin': `https://wbbny.m.jd.com`,
827 'Accept-Encoding': `gzip, deflate, br`,
828 'Cookie': $.cookie,
829 'Content-Type': `application/x-www-form-urlencoded`,
830 'Host': `api.m.jd.com`,
831 'Connection': `keep-alive`,
832 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
833 'Referer': `https://wbbny.m.jd.com`,
834 'Accept-Language': `zh-cn`
835 };
836 return {url: url, method: method, headers: headers, body: body};
837}
838
839function getPostBody(type) {
840 let taskBody = '';

Callers 1

takePostRequestFunction · 0.70

Calls 2

isNodeMethod · 0.45
getdataMethod · 0.45

Tested by

no test coverage detected