Improve this Doc View Source

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

## Methods

- ###

  `useApplyAsync([value]);`

  Configure $http service to combine processing of multiple http responses received at around the same time via $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 specifed, returns the current configured value.

  #### Parameters

  Param | Type | Details
  --- | --- | ---
  value (optional) | 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

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

## Properties

- ### `defaults`

  | Object containing default values for all $http requests. `defaults.xsrfCookieName` - {string} - Name of cookie containing the XSRF token. Defaults value is `'XSRF-TOKEN'`. `defaults.xsrfHeaderName` - {string} - Name of HTTP header to populate with the XSRF token. Defaults value is `'X-XSRF-TOKEN'`. `defaults.headers` - {Object} - Default headers for all $http requests. Refer to $http for documentation on setting default headers. `defaults.headers.common` `defaults.headers.post` `defaults.headers.put` `defaults.headers.patch`