MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromWeb

Function fromWeb

packages/effect/src/unstable/http/HttpClientRequest.ts:893–901  ·  view source on GitHub ↗
(request: globalThis.Request)

Source from the content-addressed store, hash-verified

891 * @since 4.0.0
892 */
893export const fromWeb = (request: globalThis.Request): HttpClientRequest => {
894 const method = request.method.toUpperCase() as HttpMethod
895 return modify(empty, {
896 method,
897 url: new URL(request.url),
898 headers: request.headers,
899 body: fromWebBody(request, method)
900 })
901}
902
903const fromWebBody = (request: globalThis.Request, method: HttpMethod): HttpBody.HttpBody => {
904 if (!hasBody(method) || request.body === null) {

Callers

nothing calls this directly

Calls 2

fromWebBodyFunction · 0.85
modifyFunction · 0.70

Tested by

no test coverage detected