On this page
HttpResponse
class
npm Package | @angular/common |
---|---|
Module | import { HttpResponse } from '@angular/common/http'; |
Source | common/http/src/response.ts |
Overview
class HttpResponse<T> extends HttpResponseBase {
constructor(init: {...})
get body: T | null
get type: HttpEventType.Response
clone(update: {...}): HttpResponse<any>
// inherited from common/http/HttpResponseBase
get headers: HttpHeaders
get status: number
get statusText: string
get url: string | null
get ok: boolean
get type: HttpEventType.Response | HttpEventType.ResponseHeader
}
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.
Constructor
constructor(init: { body?: T | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})
Construct a new HttpResponse
.
Members
get body: T | null
The response body, or null
if one was not returned.
get type: HttpEventType.Response
clone(update: { body?: any | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {}): HttpResponse<any>
Overloads
clone(): HttpResponse<T>
clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<T>
clone<V>(update: { body?: V | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<V>
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/common/http/HttpResponse