Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpResponseBase

Base class for both HttpResponse and HttpHeaderResponse.

Hierarchy

Index

Constructors

Properties

Constructors

constructor

  • new HttpResponseBase(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string }, defaultStatus?: number, defaultStatusText?: string): HttpResponseBase
  • Super-constructor for all responses.

    The single parameter accepted is an initialization hash. Any properties of the response passed there will override the default values.

    Parameters

    • init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string }
      • Optional headers?: HttpHeaders
      • Optional status?: number
      • Optional statusText?: string
      • Optional url?: string
    • Default value defaultStatus: number = 200
    • Default value defaultStatusText: string = "OK"

    Returns HttpResponseBase

Properties

Readonly headers

headers: HttpHeaders

All response headers.

Readonly ok

ok: boolean

Whether the status code falls in the 2xx range.

Readonly status

status: number

Response status code.

Readonly statusText

statusText: string

Textual description of response status code.

Do not depend on this.

Readonly type

Type of the response, narrowed to either the full response or the header.

Readonly url

url: string | null

URL of the resource retrieved, or null if not available.

Generated using TypeDoc