(runner: Runner): <E, R>(
client: HttpClient.HttpClient.With<E, R>
) => HttpClient.HttpClient.With<E, R>Pipe-friendly: client.pipe(HttpClientGate.withRunner(runner)).
export const const withRunner: (
runner: Runner
) => <E, R>(
client: HttpClient.HttpClient.With<E, R>
) => HttpClient.HttpClient.With<E, R>
Pipe-friendly: client.pipe(HttpClientGate.withRunner(runner)).
withRunner =
(runner: Runnerrunner: type Runner = GateRunnerA generic runner that wraps any effect with concurrency gating.
Runner) =>
<function (type parameter) E in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>E, function (type parameter) R in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>R>(client: HttpClient.HttpClient.With<E, R>(parameter) client: {
preprocess: Preprocess<E, R>;
postprocess: Postprocess<E, R>;
execute: (request: HttpClientRequest.HttpClientRequest) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
get: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
head: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
post: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
patch: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
put: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
del: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
options: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
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;
}
client: import HttpClientHttpClient.HttpClient.interface HttpClient.With<E, R = never>Parameterized HTTP client that may fail with E and require environment R.
Details
It exposes preprocessing, postprocessing, direct request execution, and method-specific helpers.
With<function (type parameter) E in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>E, function (type parameter) R in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>R>): import HttpClientHttpClient.HttpClient.interface HttpClient.With<E, R = never>Parameterized HTTP client that may fail with E and require environment R.
Details
It exposes preprocessing, postprocessing, direct request execution, and method-specific helpers.
With<function (type parameter) E in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>E, function (type parameter) R in <E, R>(client: HttpClient.HttpClient.With<E, R>): HttpClient.HttpClient.With<E, R>R> =>
import HttpClientHttpClient.const transform: {
<E, R, E1, R1>(
f: (
effect: Effect.Effect<
HttpClientResponse.HttpClientResponse,
E,
R
>,
request: HttpClientRequest.HttpClientRequest
) => Effect.Effect<
HttpClientResponse.HttpClientResponse,
E1,
R1
>
): (
self: HttpClient.With<E, R>
) => HttpClient.With<E | E1, R | R1>
<E, R, E1, R1>(
self: HttpClient.With<E, R>,
f: (
effect: Effect.Effect<
HttpClientResponse.HttpClientResponse,
E,
R
>,
request: HttpClientRequest.HttpClientRequest
) => Effect.Effect<
HttpClientResponse.HttpClientResponse,
E1,
R1
>
): HttpClient.With<E | E1, R | R1>
}
Transforms a client by wrapping the response effect for each request.
Details
The transformation receives both the response effect and the original request, allowing it to change success, error, and environment behavior.
transform(client: HttpClient.HttpClient.With<E, R>(parameter) client: {
preprocess: Preprocess<E, R>;
postprocess: Postprocess<E, R>;
execute: (request: HttpClientRequest.HttpClientRequest) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
get: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
head: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
post: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
patch: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
put: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
del: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
options: (url: string | URL, options?: HttpClientRequest.Options.NoUrl) => Effect.Effect<HttpClientResponse.HttpClientResponse, E, R>;
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;
}
client, (effect: Effect<HttpClientResponse, E, R>(parameter) effect: {
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;
}
effect, _request: HttpClientRequest(parameter) _request: {
method: HttpMethod;
url: string;
urlParams: UrlParams.UrlParams;
hash: Option.Option<string>;
headers: Headers.Headers;
body: HttpBody.HttpBody;
toString: () => string;
toJSON: () => unknown;
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; <…;
}
_request) => runner: Runnerrunner(effect: Effect<HttpClientResponse, E, R>(parameter) effect: {
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;
}
effect));