MCPcopy Create free account
hub / github.com/effect-app/libs / send

Function send

repos/effect/packages/effect/src/unstable/http/FetchHttpClient.ts:60–81  ·  view source on GitHub ↗
(body: BodyInit | undefined)

Source from the content-addressed store, hash-verified

58 : request.headers
59 if (headers["content-length"]) {
60 headers = Headers.remove(headers, "content-length")
61 }
62 const send = (body: BodyInit | undefined) =>
63 Effect.map(
64 Effect.tryPromise({
65 try: () =>
66 fetch(url, {
67 ...options,
68 method: request.method,
69 headers,
70 body,
71 duplex: request.body._tag === "Stream" ? "half" : undefined,
72 signal
73 } as any),
74 catch: (cause) =>
75 new HttpClientError.HttpClientError({
76 reason: new HttpClientError.TransportError({
77 request,
78 cause
79 })
80 })
81 }),
82 (response) => HttpClientResponse.fromWeb(request, response)
83 )
84 switch (request.body._tag) {

Callers 1

FetchHttpClient.tsFile · 0.70

Calls 2

mapMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…