# Class HttpProvider

Use `$httpProvider` to change the default behavior of the ng.$http $http service.

- Defined in src/services/http/http.js:218

##### Index

### Constructors

constructor

### Properties

$get
defaults
interceptors
useApplyAsync
xsrfTrustedOrigins

## Constructors

### constructor

- new HttpProvider(): HttpProvider

  Use `$httpProvider` to change the default behavior of the ng.$http $http service.

  #### Returns HttpProvider

  - Defined in src/services/http/http.js:218

## Properties

### $get

$get: (
| string
| (
(
$browser: any,
$httpBackend: any,
$rootScope: any,
$injector: InjectorService,
$sce: any,
) => {
defaults: {
headers: {
common: { Accept: string };
patch: any;
post: any;
put: any;
};
paramSerializer: string;
transformRequest: ((d: any) => any)[];
transformResponse: ((data: any, headers: any) => any)[];
xsrfCookieName: string;
xsrfHeaderName: string;
};
pendingRequests: any[];
(requestConfig: any): Promise<any>;
}
)
)[]

#### Type declaration

- string
- (
  $browser: any,
  $httpBackend: any,
  $rootScope: any,
  $injector: InjectorService,
  $sce: any,
  ) => {
  defaults: {
  headers: {
  common: { Accept: string };
  patch: any;
  post: any;
  put: any;
  };
  paramSerializer: string;
  transformRequest: ((d: any) => any)[];
  transformResponse: ((data: any, headers: any) => any)[];
  xsrfCookieName: string;
  xsrfHeaderName: string;
  };
  pendingRequests: any[];
  (requestConfig: any): Promise<any>;
  }
  - - (
      $browser: any,
      $httpBackend: any,
      $rootScope: any,
      $injector: InjectorService,
      $sce: any,
      ): {
      defaults: {
      headers: {
      common: { Accept: string };
      patch: any;
      post: any;
      put: any;
      };
      paramSerializer: string;
      transformRequest: ((d: any) => any)[];
      transformResponse: ((data: any, headers: any) => any)[];
      xsrfCookieName: string;
      xsrfHeaderName: string;
      };
      pendingRequests: any[];
      (requestConfig: any): Promise<any>;
      }

    - #### Parameters

      - $browser: any
      - $httpBackend: any
      - $rootScope: any
      - $injector: InjectorService
      - $sce: any

      #### Returns {
      defaults: {
      headers: {
      common: { Accept: string };
      patch: any;
      post: any;
      put: any;
      };
      paramSerializer: string;
      transformRequest: ((d: any) => any)[];
      transformResponse: ((data: any, headers: any) => any)[];
      xsrfCookieName: string;
      xsrfHeaderName: string;
      };
      pendingRequests: any[];
      (requestConfig: any): Promise<any>;
      }

      - - (requestConfig: any): Promise<any>

        - #### Parameters

          - requestConfig: any

            Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes.

          #### Returns Promise<any>

      - ##### defaults: {
        headers: { common: { Accept: string }; patch: any; post: any; put: any };
        paramSerializer: string;
        transformRequest: ((d: any) => any)[];
        transformResponse: ((data: any, headers: any) => any)[];
        xsrfCookieName: string;
        xsrfHeaderName: string;
        }

        Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of default headers, withCredentials as well as request and response transformations.

        See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.

      - ##### pendingRequests: any[]

- Defined in src/services/http/http.js:379

### defaults

defaults: {
headers: { common: { Accept: string }; patch: any; post: any; put: any };
paramSerializer: string;
transformRequest: ((d: any) => any)[];
transformResponse: ((data: any, headers: any) => any)[];
xsrfCookieName: string;
xsrfHeaderName: string;
}

- Defined in src/services/http/http.js:264

### interceptors

interceptors: any[]

- Defined in src/services/http/http.js:326

### useApplyAsync

useApplyAsync: (value: boolean) => any

Configure $http service to combine processing of multiple http responses received at around the same time via ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync. This can result in significant performance improvement for bigger applications that make many HTTP requests concurrently (common during application bootstrap).

Defaults to false. If no value is specified, returns the current configured value.

#### Type declaration

- - (value: boolean): any

  - #### Parameters

    - value: boolean

      If true, when requests are loaded, they will schedule a deferred "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window to load and share the same digest cycle.

    #### Returns any

    If a value is specified, returns the $httpProvider for chaining. otherwise, returns the current configured value.

- Defined in src/services/http/http.js:309

### xsrfTrustedOrigins

xsrfTrustedOrigins: any[]

- Defined in src/services/http/http.js:364