Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing an HTTP response to a client.

Hierarchy

  • Response

Index

Constructors

constructor

Properties

body

body: string | Buffer | Readable | Uint8Array = ''

The body contents that should be written to the response.

Private headers

headers: {} = {}

Mapping of headers that should be sent back to the client.

Type declaration

  • [key: string]: string | string[]

Private isBlockingWriteback

isBlockingWriteback: boolean = false

If this is true, then some module in the kernel has flagged the response as being interrupted and handled. Subsequent modules should NOT overwrite the response.

Readonly request

request: Request

Private responseEnded

responseEnded: boolean = false

True if the response has been sent and closed.

Readonly sending$

sending$: BehaviorSubject<Response> = ...

Behavior subject fired right before the response content is written.

Readonly sent$

Behavior subject fired right after the response content is written.

Private sentHeaders

sentHeaders: boolean = false

True if the headers have been sent.

Protected Readonly serverResponse

serverResponse: ServerResponse

Private status

status: HTTPStatus = ...

The HTTP status code that should be sent to the client.

Accessors

cookies

Methods

appendHeader

  • appendHeader(name: string, value: string | string[]): Response

blockingWriteback

  • blockingWriteback(set?: boolean): boolean
  • Get or set the flag for whether the writeback should be blocked.

    Parameters

    • Optional set: boolean

      if this is specified, the value will be set.

    Returns boolean

end

getHeader

  • getHeader(name: string): undefined | string | string[]

getStatus

hasBody

  • hasBody(): boolean

hasSentHeaders

  • hasSentHeaders(): boolean

send

  • send(): Promise<void>

sendHeaders

setHeader

  • setHeader(name: string, value: string | string[]): Response

setHeaders

setStatus

write

  • write(data: string | Buffer | Readable | Uint8Array): Promise<void>
  • Write the headers and specified data to the client.

    Parameters

    • data: string | Buffer | Readable | Uint8Array

    Returns Promise<void>

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.