{ "id": "api/common/http/HttpResponse", "title": "HttpResponse", "contents": "\n\n
\n
\n
\n \n API > @angular/common > @angular/common/http\n
\n \n
\n \n
\n

HttpResponselink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

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

\n\n

See more...

\n
\n \n \n \n
\n\nclass HttpResponse<T> extends HttpResponseBase {\n constructor(init: { body?: T; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})\n body: T | null\n type: HttpEventType.Response\n clone(update: { body?: any; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {}): HttpResponse<any>\n\n // inherited from common/http/HttpResponseBase\n constructor(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }, defaultStatus: number = HttpStatusCode.Ok, defaultStatusText: string = 'OK')\n headers: HttpHeaders\n status: number\n statusText: string\n url: string | null\n ok: boolean\n type: HttpEventType.Response | HttpEventType.ResponseHeader\n}\n\n\n \n \n\n
\n\n\n \n\n \n \n
\n

Descriptionlink

\n

HttpResponse is a HttpEvent available on the response event\nstream.

\n\n \n
\n\n \n\n\n\n\n\n\n

Constructorlink

\n\n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n

Construct a new HttpResponse.

\n\n
\n
\n \n\n constructor(init: { body?: T; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n init\n object\n

Optional. Default is {}.

\n \n
\n\n \n\n\n \n\n \n
\n
\n\n\n\n\n
\n

Propertieslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyDescription
\n \n body: T | null\n Read-Only\n \n

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

\n\n \n
\n \n type: HttpEventType.Response\n Read-Only\n \n \n \n
\n
\n\n\n\n
\n

Methodslink

\n \n \n\n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n clone()\n \n link

\n \n
\n
\n
\n \n
\n

3 overloads...

\n \n Show All\n Hide All\n expand_more\n \n
\n
\n
\n \n \n
Overload #1
\n
\n \n\n clone(): HttpResponse<T>\n\n \n\n
Parameters
\n

There are no parameters.

\n\n \n
Returns
\n

HttpResponse<T>

\n\n \n\n\n \n\n \n
\n
\n \n
Overload #2
\n
\n \n\n clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<T>\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n update\n object\n \n \n
\n\n \n
Returns
\n

HttpResponse<T>

\n\n \n\n\n \n\n \n
\n
\n \n
Overload #3
\n
\n \n\n clone<V>(update: { body?: V; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<V>\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n update\n object\n \n \n
\n\n \n
Returns
\n

HttpResponse<V>

\n\n \n\n\n \n\n \n
\n \n \n
\n
\n
\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }