MCPcopy Index your code
hub / github.com/ritz078/transform / request

Function request

utils/request.ts:5–20  ·  view source on GitHub ↗
(
  url: string,
  data: any,
  contentType = "application/json"
)

Source from the content-addressed store, hash-verified

3
4let cancelTokenSource: CancelTokenSource;
5export default async function request(
6 url: string,
7 data: any,
8 contentType = "application/json"
9) {
10 if (cancelTokenSource) cancelTokenSource.cancel();
11 cancelTokenSource = axios.CancelToken.source();
12
13 const res = await axios.post(url, data, {
14 cancelToken: cancelTokenSource.token,
15 headers: { "Content-Type": contentType }
16 });
17
18 cancelTokenSource = null;
19 return res.data;
20}

Callers 10

FlowToTypescriptFunction · 0.85
TypescriptToJsonSchemaFunction · 0.85
TypescriptToFlowFunction · 0.85
FlowToJavascriptFunction · 0.85
TypescriptToZodFunction · 0.85
HtmlToPugFunction · 0.85
TypescriptToJavascriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…