MCPcopy Index your code
hub / github.com/Effect-TS/effect / send

Function send

packages/platform/src/internal/fetchHttpClient.ts:23–43  ·  view source on GitHub ↗
(body: BodyInit | undefined)

Source from the content-addressed store, hash-verified

21 headers = Headers.remove(headers, "content-length")
22 }
23 const send = (body: BodyInit | undefined) =>
24 Effect.map(
25 Effect.tryPromise({
26 try: () =>
27 fetch(url, {
28 ...options,
29 method: request.method,
30 headers,
31 body,
32 duplex: request.body._tag === "Stream" ? "half" : undefined,
33 signal
34 } as any),
35 catch: (cause) =>
36 new Error.RequestError({
37 request,
38 reason: "Transport",
39 cause
40 })
41 }),
42 (response) => internalResponse.fromWeb(request, response)
43 )
44 switch (request.body._tag) {
45 case "Raw":
46 case "Uint8Array":

Callers 1

fetchHttpClient.tsFile · 0.70

Calls 2

mapMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected