This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

HttpClientModule

Configures the dependency injector for HttpClient with supporting services for XSRF. Automatically imported by HttpClientModule.

See more...

class HttpClientModule { }
      
      class HttpClientModule {
}
    

Description

You can add interceptors to the chain behind HttpClient by binding them to the multiprovider for built-in DI token HTTP_INTERCEPTORS.

Providers

Provider
      
      HttpClient
    
{ provide: HttpHandler, useClass: HttpInterceptingHandler }
      
      { provide: HttpHandler, useClass: HttpInterceptingHandler }
    
      
      HttpXhrBackend
    
{ provide: HttpBackend, useExisting: HttpXhrBackend }
      
      { provide: HttpBackend, useExisting: HttpXhrBackend }
    
      
      BrowserXhr
    
{ provide: XhrFactory, useExisting: BrowserXhr }
      
      { provide: XhrFactory, useExisting: BrowserXhr }