MCPcopy
hub / github.com/Tencent/CodeAnalysis / request

Function request

web/packages/tca-analysis/src/services/index.ts:47–58  ·  view source on GitHub ↗
(url: string, options?: any)

Source from the content-addressed store, hash-verified

45}
46
47function request(url: string, options?: any) {
48 return fetch(url, {
49 headers: {
50 'Content-Type': 'application/json',
51 },
52 credentials: 'include',
53 ...options,
54 })
55 .then(jsonInterceptor)
56 .then(errorInterceptor)
57 .catch((err: any) => Promise.reject(err));
58}
59
60export function get(url: string, data?: any) {
61 return request(`${url}${isEmpty(data) ? '' : `?${qs.stringify(data)}`}`, {

Callers 4

getFunction · 0.85
postFunction · 0.85
putFunction · 0.85
delFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected