HttpClientResponse
Accessors
Constructors
Filters
filterStatus
Added in v1.0.0
Source
Signature
declare const filterStatus: {
(
f: (status: number) => boolean,
): (self: HttpClientResponse) => Effect<HttpClientResponse, ResponseError>;
(
self: HttpClientResponse,
f: (status: number) => boolean,
): Effect<HttpClientResponse, ResponseError>;
};filterStatusOk
Added in v1.0.0
Source
Signature
declare const filterStatusOk: (
self: HttpClientResponse,
) => Effect.Effect<HttpClientResponse, Error.ResponseError>;Models
HttpClientResponse interface
Added in v1.0.0
Source
Signature
interface HttpClientResponse extends HttpIncomingMessage<Error.ResponseError> {
readonly [TypeId]: typeof TypeId;
readonly cookies: Cookies;
readonly formData: Effect<FormData, ResponseError>;
readonly request: HttpClientRequest;
readonly status: number;
}Pattern Matching
matchStatus
Added in v1.0.0
Source
Signature
declare const matchStatus: {
<
Cases extends {
[status: number]: (_: HttpClientResponse) => any;
readonly "2xx"?: (_: HttpClientResponse) => any;
readonly "3xx"?: (_: HttpClientResponse) => any;
readonly "4xx"?: (_: HttpClientResponse) => any;
readonly "5xx"?: (_: HttpClientResponse) => any;
readonly orElse: (_: HttpClientResponse) => any;
},
>(
cases: Cases,
): (self: HttpClientResponse) => Cases[keyof Cases] extends (_: any) => R ? Unify<R> : never;
<
Cases extends {
[status: number]: (_: HttpClientResponse) => any;
readonly "2xx"?: (_: HttpClientResponse) => any;
readonly "3xx"?: (_: HttpClientResponse) => any;
readonly "4xx"?: (_: HttpClientResponse) => any;
readonly "5xx"?: (_: HttpClientResponse) => any;
readonly orElse: (_: HttpClientResponse) => any;
},
>(
self: HttpClientResponse,
cases: Cases,
): Cases[keyof Cases] extends (_: any) => R ? Unify<R> : never;
};Schema
schemaBodyJson
Added in v1.0.0
Source
Signature
declare function schemaBodyJson<A, I, R>(
schema: any,
options?: ParseOptions,
): <E>(self: HttpIncomingMessage<E>) => Effect<A, any, R>;schemaBodyUrlParams
Added in v1.0.0
Source
Signature
declare function schemaBodyUrlParams<A, I extends Readonly<Record<string, string | readonly Array<string> | undefined>>, R>(schema: any, options?: ParseOptions): <E>(self: HttpIncomingMessage<E>) => Effect<A, any, R>schemaHeaders
Added in v1.0.0
Source
Signature
declare function schemaHeaders<A, I extends Readonly<Record<string, string | undefined>>, R>(
schema: any,
options?: ParseOptions,
): <E>(self: HttpIncomingMessage<E>) => Effect<A, ParseError, R>;schemaJson
Added in v1.0.0
Source
Signature
declare const schemaJson: <
R,
I extends {
readonly body?: unknown;
readonly headers?: Readonly<Record<string, string>>;
readonly status?: number;
},
A,
>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions,
) => (
self: HttpClientResponse,
) => Effect.Effect<A, Error.ResponseError | ParseResult.ParseError, R>;schemaNoBody
Added in v1.0.0
Source
Signature
declare const schemaNoBody: <
R,
I extends {
readonly headers?: Readonly<Record<string, string>>;
readonly status?: number;
},
A,
>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions,
) => (self: HttpClientResponse) => Effect.Effect<A, ParseResult.ParseError, R>;