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

Function taskUrl

jd_pet.js:639–652  ·  view source on GitHub ↗
(function_id, body = {})

Source from the content-addressed store, hash-verified

637// };
638// }
639function taskUrl(function_id, body = {}) {
640 body["version"] = 2;
641 body["channel"] = 'app';
642 return {
643 url: `${JD_API_HOST}?functionId=${function_id}`,
644 body: `body=${escape(JSON.stringify(body))}&appid=wh5&loginWQBiz=pet-town&clientVersion=9.0.4`,
645 headers: {
646 'Cookie': cookie,
647 '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"),
648 'Host': 'api.m.jd.com',
649 'Content-Type': 'application/x-www-form-urlencoded',
650 }
651 };
652}
653function jsonParse(str) {
654 if (typeof str == "string") {
655 try {

Callers 1

requestFunction · 0.70

Calls 2

isNodeMethod · 0.45
getdataMethod · 0.45

Tested by

no test coverage detected