Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

HttpClientResponse.ts overview

Since v1.0.0


Exports Grouped by Category


accessors

stream

Signature

declare const stream: <E, R>(
  effect: Effect.Effect<HttpClientResponse, E, R>
) => Stream.Stream<Uint8Array, Error.ResponseError | E, R>

Source

Since v1.0.0

constructors

fromWeb

Signature

declare const fromWeb: (request: ClientRequest.HttpClientRequest, source: Response) => HttpClientResponse

Source

Since v1.0.0

filters

filterStatus

Signature

declare const filterStatus: {
  (f: (status: number) => boolean): (self: HttpClientResponse) => Effect.Effect<HttpClientResponse, Error.ResponseError>
  (self: HttpClientResponse, f: (status: number) => boolean): Effect.Effect<HttpClientResponse, Error.ResponseError>
}

Source

Since v1.0.0

filterStatusOk

Signature

declare const filterStatusOk: (self: HttpClientResponse) => Effect.Effect<HttpClientResponse, Error.ResponseError>

Source

Since v1.0.0

models

HttpClientResponse (interface)

Signature

export interface HttpClientResponse extends IncomingMessage.HttpIncomingMessage<Error.ResponseError> {
  readonly [TypeId]: TypeId
  readonly request: ClientRequest.HttpClientRequest
  readonly status: number
  readonly cookies: Cookies.Cookies
  readonly formData: Effect.Effect<FormData, Error.ResponseError>
}

Source

Since v1.0.0

pattern matching

matchStatus

Signature

declare const matchStatus: {
  <
    const Cases extends {
      readonly [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) => infer R ? Unify<R> : never
  <
    const Cases extends {
      readonly [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) => infer R ? Unify<R> : never
}

Source

Since v1.0.0

schema

schemaBodyJson

Signature

declare const schemaBodyJson: <A, I, R>(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
) => <E>(self: IncomingMessage.HttpIncomingMessage<E>) => Effect.Effect<A, E | ParseResult.ParseError, R>

Source

Since v1.0.0

schemaBodyUrlParams

Signature

declare const schemaBodyUrlParams: <
  A,
  I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>,
  R
>(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
) => <E>(self: IncomingMessage.HttpIncomingMessage<E>) => Effect.Effect<A, E | ParseResult.ParseError, R>

Source

Since v1.0.0

schemaHeaders

Signature

declare const schemaHeaders: <A, I extends Readonly<Record<string, string | undefined>>, R>(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
) => <E>(self: IncomingMessage.HttpIncomingMessage<E>) => Effect.Effect<A, ParseResult.ParseError, R>

Source

Since v1.0.0

schemaJson

Signature

declare const schemaJson: <
  R,
  I extends {
    readonly status?: number | undefined
    readonly headers?: Readonly<Record<string, string>> | undefined
    readonly body?: unknown
  },
  A
>(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
) => (self: HttpClientResponse) => Effect.Effect<A, Error.ResponseError | ParseResult.ParseError, R>

Source

Since v1.0.0

schemaNoBody

Signature

declare const schemaNoBody: <
  R,
  I extends { readonly status?: number | undefined; readonly headers?: Readonly<Record<string, string>> | undefined },
  A
>(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
) => (self: HttpClientResponse) => Effect.Effect<A, ParseResult.ParseError, R>

Source

Since v1.0.0

type ids

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0