* @ngdoc provider * @name $httpProvider * @this * * @description * Use `$httpProvider` to change the default behavior of the ng.$http $http service.
()
| 12202 | * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. |
| 12203 | */ |
| 12204 | function $HttpProvider() { |
| 12205 | /** |
| 12206 | * @ngdoc property |
| 12207 | * @name $httpProvider#defaults |
| 12208 | * @description |
| 12209 | * |
| 12210 | * Object containing default values for all {@link ng.$http $http} requests. |
| 12211 | * |
| 12212 | * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with |
| 12213 | * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses |
| 12214 | * by default. See {@link $http#caching $http Caching} for more information. |
| 12215 | * |
| 12216 | * - **`defaults.headers`** - {Object} - Default headers for all $http requests. |
| 12217 | * Refer to {@link ng.$http#setting-http-headers $http} for documentation on |
| 12218 | * setting default headers. |
| 12219 | * - **`defaults.headers.common`** |
| 12220 | * - **`defaults.headers.post`** |
| 12221 | * - **`defaults.headers.put`** |
| 12222 | * - **`defaults.headers.patch`** |
| 12223 | * |
| 12224 | * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the |
| 12225 | * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the |
| 12226 | * {@link $jsonpCallbacks} service. Defaults to `'callback'`. |
| 12227 | * |
| 12228 | * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function |
| 12229 | * used to the prepare string representation of request parameters (specified as an object). |
| 12230 | * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. |
| 12231 | * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. |
| 12232 | * |
| 12233 | * - **`defaults.transformRequest`** - |
| 12234 | * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` - |
| 12235 | * An array of functions (or a single function) which are applied to the request data. |
| 12236 | * By default, this is an array with one request transformation function: |
| 12237 | * |
| 12238 | * - If the `data` property of the request configuration object contains an object, serialize it |
| 12239 | * into JSON format. |
| 12240 | * |
| 12241 | * - **`defaults.transformResponse`** - |
| 12242 | * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` - |
| 12243 | * An array of functions (or a single function) which are applied to the response data. By default, |
| 12244 | * this is an array which applies one response transformation function that does two things: |
| 12245 | * |
| 12246 | * - If XSRF prefix is detected, strip it |
| 12247 | * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}). |
| 12248 | * - If the `Content-Type` is `application/json` or the response looks like JSON, |
| 12249 | * deserialize it using a JSON parser. |
| 12250 | * |
| 12251 | * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. |
| 12252 | * Defaults value is `'XSRF-TOKEN'`. |
| 12253 | * |
| 12254 | * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the |
| 12255 | * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. |
| 12256 | * |
| 12257 | */ |
| 12258 | var defaults = this.defaults = { |
| 12259 | // transform incoming response data |
| 12260 | transformResponse: [defaultHttpResponseTransform], |
| 12261 |
nothing calls this directly
no test coverage detected