• Overview
@angular/common/http

HttpClientXsrfModule

NgModule
Deprecated

Configures XSRF protection support for outgoing requests.

API

  
    class HttpClientXsrfModule {}
  
  

disable

ModuleWithProviders<HttpClientXsrfModule>

Disable the default XSRF protection.

withOptions

ModuleWithProviders<HttpClientXsrfModule>

Configure XSRF protection.

@paramoptions{ cookieName?: string | undefined; headerName?: string | undefined; }

An object that can specify either or both cookie name or header name.

  • Cookie name default is XSRF-TOKEN.
  • Header name default is X-XSRF-TOKEN.

Description

Configures XSRF protection support for outgoing requests.

For a server that supports a cookie-based XSRF protection system, use directly to configure XSRF protection with the correct cookie and header names.

If no names are supplied, the default cookie name is XSRF-TOKEN and the default header name is X-XSRF-TOKEN.

Jump to details