Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HttpResponse<Payload>

HTTP Response abstraction.

Type parameters

  • Payload

    Response payload.

Hierarchy

  • HttpResponse

Properties

Methods

Properties

Readonly sent

sent: boolean

Whether the request was sent.

Methods

header

  • Set header field to value.

    Parameters

    • field: string

      Name of the header.

    • value: HttpHeaderValue

      Value of the header.

    Returns HttpResponse<Payload>

send

  • send(payload?: Payload): void
  • Send a response.

    Parameters

    • Optional payload: Payload

      Response payload.

    Returns void

status

type

  • Set Content-Type response header with type.
    It's recommended to be set with the help of mime-types npm package.

    Parameters

    • mimeType: string

    Returns HttpResponse<Payload>