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

Method ctripRequest

wxapp/ctrip.js:359–373  ·  view source on GitHub ↗
(pathname, data = {}, { addHead = true } = {})

Source from the content-addressed store, hash-verified

357 }
358
359 async ctripRequest(pathname, data = {}, { addHead = true } = {}) {
360 const body = { ...(data || {}) };
361 if (addHead) body.head = this.dataHead(body.head || {});
362 const raw = JSON.stringify(body);
363 const res = await axios.post(`${API_BASE}${pathname}?_fxpcqlniredt=${CLIENT_ID}`, raw, {
364 timeout: 30000,
365 validateStatus: () => true,
366 headers: this.headers(raw),
367 });
368 return {
369 status: res.status,
370 data: res.data,
371 text: typeof res.data === "string" ? res.data : JSON.stringify(res.data),
372 };
373 }
374
375 async querySignStatus() {
376 const res = await this.ctripRequest("/restapi/soa2/13012/getSignTodayInfoProxy", {});

Callers 2

querySignStatusMethod · 0.95
trySignEndpointMethod · 0.95

Calls 3

dataHeadMethod · 0.95
headersMethod · 0.95
postMethod · 0.45

Tested by

no test coverage detected