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

Function taskPostUrl

jd_get_share_code.js:719–743  ·  view source on GitHub ↗
(function_id, body = {}, function_id2)

Source from the content-addressed store, hash-verified

717 })
718}
719function taskPostUrl(function_id, body = {}, function_id2) {
720 let url = `${JD_API_HOST}`;
721 if (function_id2) {
722 url += `?functionId=${function_id2}`;
723 }
724 return {
725 url,
726 body: `functionId=${function_id}&body=${escape(
727 JSON.stringify(body)
728 )}&client=wh5&clientVersion=9.1.0`,
729 headers: {
730 Cookie: cookie,
731 origin: "https://h5.m.jd.com",
732 referer: "https://h5.m.jd.com/",
733 "Content-Type": "application/x-www-form-urlencoded",
734 "User-Agent": $.isNode()
735 ? process.env.JD_USER_AGENT
736 ? process.env.JD_USER_AGENT
737 : "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"
738 : $.getdata("JDUA")
739 ? $.getdata("JDUA")
740 : "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",
741 },
742 };
743}
744function jsonParse(str) {
745 if (typeof str == "string") {
746 try {

Callers 1

getJdFactoryFunction · 0.70

Calls 2

isNodeMethod · 0.45
getdataMethod · 0.45

Tested by

no test coverage detected