HttpHeaderResponse
A partial HTTP response which only includes the status and header data, but no response body.
constructor
HttpHeaderResponse
Create a new HttpHeaderResponse
with the given parameters.
{ headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; }
HttpHeaderResponse
clone
HttpHeaderResponse
Copy this HttpHeaderResponse
, overriding its contents with the
given parameter hash.
{ headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; }
HttpHeaderResponse
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
responseType
ResponseType | undefined
Indicates the type of the HTTP response, based on how the request was made and how the browser handles the response.
This corresponds to the type
property of the Fetch API's Response
object, which can indicate values such as:
'basic'
: A same-origin response, allowing full access to the body and headers.'cors'
: A cross-origin response with CORS enabled, exposing only safe response headers.'opaque'
: A cross-origin response made withno-cors
, where the response body and headers are inaccessible.'opaqueredirect'
: A response resulting from a redirect followed inno-cors
mode.'error'
: A response representing a network error or similar failure.
This property is only available when using the Fetch-based backend (via withFetch()
).
When using Angular's (XHR) backend, this value will be undefined
.
Description
A partial HTTP response which only includes the status and header data, but no response body.
HttpHeaderResponse
is a HttpEvent
available on the response
event stream, only when progress events are requested.