withXhr
function
stable
Configures the current HttpClient instance to make requests using the Xhr API.
@returns
HttpFeature<HttpFeatureKind.Xhr>Description
Configures the current HttpClient instance to make requests using the Xhr API.
Use this feature if you want to report progress on uploads as the Xhr API supports it.
Do not use withXhr in server-side rendering (SSR) environments. XHR support on the
server is deprecated and is intended to be removed in Angular 23 because the underlying xhr2
library does not safely handle redirects (e.g. it can forward Authorization headers on
cross-origin redirects and is susceptible to denial-of-service via redirect loops).
Jump to details