NodeHttpClient.layerNodeHttpNoAgentconstrepos/effect/packages/platform-node/src/NodeHttpClient.ts:651Layer.Layer<Client.HttpClient, never, HttpAgent>Provides a node:http-backed HttpClient using the current HttpAgent
service.
export const const layerNodeHttpNoAgent: Layer.Layer<
Client.HttpClient,
never,
HttpAgent
>
const layerNodeHttpNoAgent: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<HttpClient>, never, HttpAgent>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Provides a node:http-backed HttpClient using the current HttpAgent
service.
layerNodeHttpNoAgent: import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<
import ClientClient.HttpClient,
never,
class HttpAgentclass HttpAgent {
key: Identifier;
Service: {
http: Http.Agent;
https: Https.Agent;
};
}
Service tag for the paired Node http and https agents used by the
node:http-backed HTTP client.
HttpAgent
> = import ClientClient.const layerMergedContext: <E, R>(
effect: Effect.Effect<Client.HttpClient, E, R>
) => Layer.Layer<Client.HttpClient, E, R>
Creates an HttpClient layer and merges the layer construction context into client response effects.
layerMergedContext(const makeNodeHttp: Effect.Effect<
Client.HttpClient,
never,
HttpAgent
>
const makeNodeHttp: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Creates an HttpClient backed by Node http and https, using the
current HttpAgent, streaming request bodies, and wrapping Node responses
as HttpClientResponse values.
makeNodeHttp)