• Overview
@angular/common/http

HttpResponse

Class
stable

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

API

    
      class HttpResponse<T> extends HttpResponseBase {
}

constructor

HttpResponse<T>

Construct a new HttpResponse.

@paraminit{ body?: T | null | undefined; headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; redirected?: boolean | undefined; }
@returnsHttpResponse<T>

body

T | null

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

clone

3 overloads
@returnsHttpResponse<T>
@paramupdate{ headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; redirected?: boolean | undefined; }
@returnsHttpResponse<T>
@paramupdate{ body?: V | null | undefined; headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; redirected?: boolean | undefined; }
@returnsHttpResponse<V>

headers

HttpHeaders

All response headers.

status

number

Response status code.

statusText

string

Textual description of response status code, defaults to OK.

Do not depend on this.

url

string | null

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

ok

boolean

Whether the status code falls in the 2xx range.

redirected

boolean | undefined

Indicates whether the HTTP response was redirected during the request. This property is only available when using the Fetch API using withFetch() When using the default XHR Request this property will be undefined

Description

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.

Jump to details