MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / headers

Method headers

wxapp/haitian.js:175–191  ·  view source on GitHub ↗
(extra = {}, auth = true, isJson = false)

Source from the content-addressed store, hash-verified

173 }
174
175 headers(extra = {}, auth = true, isJson = false) {
176 const headers = {
177 "Connection": "keep-alive",
178 "envVersion": "release",
179 "Content-Type": isJson ? "application/json" : "application/x-www-form-urlencoded",
180 "uuid": this.uuid,
181 "Accept-Encoding": "gzip,compress,br,deflate",
182 "User-Agent": defaultUserAgent,
183 "Referer": `https://servicewechat.com/${MINI_APP_ID}/${PAGE_VERSION}/page-frame.html`,
184 ...extra,
185 };
186 if (auth) {
187 headers.Authorization = this.token;
188 if (this.communityToken) headers["X-Haday-Token"] = this.communityToken;
189 }
190 return headers;
191 }
192
193 async request(pathname, { method = "GET", params, data, auth = true, isJson = false, base = API_BASE } = {}) {
194 const options = {

Callers 1

requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected