MCPcopy Create free account
hub / github.com/SecureAI-Tools/SecureAI-Tools / fetchHelper

Function fetchHelper

apps/web/lib/fe/api.ts:123–138  ·  view source on GitHub ↗
(
  method: HttpMethod,
  input: RequestInfo,
  req: REQ | null,
  init?: RequestInit,
)

Source from the content-addressed store, hash-verified

121}
122
123async function fetchHelper<REQ>(
124 method: HttpMethod,
125 input: RequestInfo,
126 req: REQ | null,
127 init?: RequestInit,
128): Promise<Response> {
129 return await fetch(input, {
130 ...init,
131 method: method,
132 body: req ? JSON.stringify(req) : null,
133 headers: {
134 ...init?.headers,
135 "Content-Type": "application/json",
136 },
137 });
138}
139
140const parseResponseHeaders = (res: Response): ResponseHeaders => {
141 return {

Callers 2

makeRequestFunction · 0.85
makeRequestStreamingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected