* @ngdoc provider * @name $httpProvider * @this * * @description * Use `$httpProvider` to change the default behavior of the ng.$http $http service.
()
| 12137 | * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. |
| 12138 | */ |
| 12139 | function $HttpProvider() { |
| 12140 | /** |
| 12141 | * @ngdoc property |
| 12142 | * @name $httpProvider#defaults |
| 12143 | * @description |
| 12144 | * |
| 12145 | * Object containing default values for all {@link ng.$http $http} requests. |
| 12146 | * |
| 12147 | * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with |
| 12148 | * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses |
| 12149 | * by default. See {@link $http#caching $http Caching} for more information. |
| 12150 | * |
| 12151 | * - **`defaults.headers`** - {Object} - Default headers for all $http requests. |
| 12152 | * Refer to {@link ng.$http#setting-http-headers $http} for documentation on |
| 12153 | * setting default headers. |
| 12154 | * - **`defaults.headers.common`** |
| 12155 | * - **`defaults.headers.post`** |
| 12156 | * - **`defaults.headers.put`** |
| 12157 | * - **`defaults.headers.patch`** |
| 12158 | * |
| 12159 | * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the |
| 12160 | * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the |
| 12161 | * {@link $jsonpCallbacks} service. Defaults to `'callback'`. |
| 12162 | * |
| 12163 | * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function |
| 12164 | * used to the prepare string representation of request parameters (specified as an object). |
| 12165 | * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. |
| 12166 | * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. |
| 12167 | * |
| 12168 | * - **`defaults.transformRequest`** - |
| 12169 | * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` - |
| 12170 | * An array of functions (or a single function) which are applied to the request data. |
| 12171 | * By default, this is an array with one request transformation function: |
| 12172 | * |
| 12173 | * - If the `data` property of the request configuration object contains an object, serialize it |
| 12174 | * into JSON format. |
| 12175 | * |
| 12176 | * - **`defaults.transformResponse`** - |
| 12177 | * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` - |
| 12178 | * An array of functions (or a single function) which are applied to the response data. By default, |
| 12179 | * this is an array which applies one response transformation function that does two things: |
| 12180 | * |
| 12181 | * - If XSRF prefix is detected, strip it |
| 12182 | * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}). |
| 12183 | * - If the `Content-Type` is `application/json` or the response looks like JSON, |
| 12184 | * deserialize it using a JSON parser. |
| 12185 | * |
| 12186 | * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. |
| 12187 | * Defaults value is `'XSRF-TOKEN'`. |
| 12188 | * |
| 12189 | * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the |
| 12190 | * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. |
| 12191 | * |
| 12192 | */ |
| 12193 | var defaults = this.defaults = { |
| 12194 | // transform incoming response data |
| 12195 | transformResponse: [defaultHttpResponseTransform], |
| 12196 |
nothing calls this directly
no test coverage detected