Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpResponse<T>

A full HTTP response, including a typed response body (which may be null if one was not returned).

HttpResponse is a HttpEvent available on the response event stream.

Type parameters

  • T

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new HttpResponse(init?: { body?: T | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string }): HttpResponse
  • Construct a new HttpResponse.

    Parameters

    • Default value init: { body?: T | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string } = {}
      • Optional body?: T | null
      • Optional headers?: HttpHeaders
      • Optional status?: number
      • Optional statusText?: string
      • Optional url?: string

    Returns HttpResponse

Properties

Readonly body

body: T | null

The response body, or null if one was not returned.

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: Response = HttpEventType.Response

Readonly url

url: string | null

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

Methods

clone

Generated using TypeDoc