MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getHeaders

Method getHeaders

wxapp/wb.js:172–184  ·  view source on GitHub ↗
(method, apiPath, payload)

Source from the content-addressed store, hash-verified

170 }
171
172 getHeaders(method, apiPath, payload) {
173 const timestamp = String(Date.now());
174 return {
175 "User-Agent": USER_AGENT,
176 "Referer": `https://servicewechat.com/${MINI_APP_ID}/${PAGE_VERSION}/page-frame.html`,
177 "Accept": "application/json, text/plain, */*",
178 "Content-Type": "application/json",
179 "X-Request-Lang": "zh-CN",
180 "Authorization": this.token || "",
181 "x-request-ts": timestamp,
182 "x-request-sign": getSign(method, `/${apiPath}`, payload, timestamp),
183 };
184 }
185
186 async request(apiPath, data = {}, method = "GET", options = {}) {
187 const payload = options.enterpriseNo ? { ...data } : { enterpriseNo: ENTERPRISE_NO, ...data };

Callers 1

requestMethod · 0.95

Calls 1

getSignFunction · 0.85

Tested by

no test coverage detected