[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/http/HttpClientXsrfModule [Back]  [Original]

HttpClientXsrfModule Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common/http

HttpClientXsrfModule

NgModule
deprecated

Configures XSRF protection support for outgoing requests.

Deprecation warning

Use withXsrfConfiguration({cookieName: 'XSRF-TOKEN', headerName: 'X-XSRF-TOKEN'}) as providers instead or withNoXsrfProtection if you want to disabled XSRF protection.

orthos-back.svg [orthos-back.svg]

On this page

    arrow_upward_alt Back to the top

    API

        
          class HttpClientXsrfModule {  static disable(): ModuleWithProviders<HttpClientXsrfModule>;  static withOptions(options?: { cookieName?: string | undefined; headerName?: string | undefined; }): ModuleWithProviders<HttpClientXsrfModule>;}
        
        

    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

    Web Proxy Viewer  |  New URL  |  Original Page