* @ngdoc provider * @name $httpProvider * @description * Use `$httpProvider` to change the default behavior of the ng.$http $http service. *
()
| 8742 | * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. |
| 8743 | * */ |
| 8744 | function $HttpProvider() { |
| 8745 | /** |
| 8746 | * @ngdoc property |
| 8747 | * @name $httpProvider#defaults |
| 8748 | * @description |
| 8749 | * |
| 8750 | * Object containing default values for all {@link ng.$http $http} requests. |
| 8751 | * |
| 8752 | * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`} |
| 8753 | * that will provide the cache for all requests who set their `cache` property to `true`. |
| 8754 | * If you set the `default.cache = false` then only requests that specify their own custom |
| 8755 | * cache object will be cached. See {@link $http#caching $http Caching} for more information. |
| 8756 | * |
| 8757 | * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. |
| 8758 | * Defaults value is `'XSRF-TOKEN'`. |
| 8759 | * |
| 8760 | * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the |
| 8761 | * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. |
| 8762 | * |
| 8763 | * - **`defaults.headers`** - {Object} - Default headers for all $http requests. |
| 8764 | * Refer to {@link ng.$http#setting-http-headers $http} for documentation on |
| 8765 | * setting default headers. |
| 8766 | * - **`defaults.headers.common`** |
| 8767 | * - **`defaults.headers.post`** |
| 8768 | * - **`defaults.headers.put`** |
| 8769 | * - **`defaults.headers.patch`** |
| 8770 | * |
| 8771 | **/ |
| 8772 | var defaults = this.defaults = { |
| 8773 | // transform incoming response data |
| 8774 | transformResponse: [defaultHttpResponseTransform], |
| 8775 | |
| 8776 | // transform outgoing request data |
| 8777 | transformRequest: [function(d) { |
| 8778 | return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d; |
| 8779 | }], |
| 8780 | |
| 8781 | // default headers |
| 8782 | headers: { |
| 8783 | common: { |
| 8784 | 'Accept': 'application/json, text/plain, */*' |
| 8785 | }, |
| 8786 | post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), |
| 8787 | put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), |
| 8788 | patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) |
| 8789 | }, |
| 8790 | |
| 8791 | xsrfCookieName: 'XSRF-TOKEN', |
| 8792 | xsrfHeaderName: 'X-XSRF-TOKEN' |
| 8793 | }; |
| 8794 | |
| 8795 | var useApplyAsync = false; |
| 8796 | /** |
| 8797 | * @ngdoc method |
| 8798 | * @name $httpProvider#useApplyAsync |
| 8799 | * @description |
| 8800 | * |
| 8801 | * Configure $http service to combine processing of multiple http responses received at around |
nothing calls this directly
no test coverage detected