* @ngdoc provider * @name $httpProvider * @this * * @description * Use `$httpProvider` to change the default behavior of the ng.$http $http service. *
()
| 11495 | * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. |
| 11496 | * */ |
| 11497 | function $HttpProvider() { |
| 11498 | /** |
| 11499 | * @ngdoc property |
| 11500 | * @name $httpProvider#defaults |
| 11501 | * @description |
| 11502 | * |
| 11503 | * Object containing default values for all {@link ng.$http $http} requests. |
| 11504 | * |
| 11505 | * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with |
| 11506 | * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses |
| 11507 | * by default. See {@link $http#caching $http Caching} for more information. |
| 11508 | * |
| 11509 | * - **`defaults.headers`** - {Object} - Default headers for all $http requests. |
| 11510 | * Refer to {@link ng.$http#setting-http-headers $http} for documentation on |
| 11511 | * setting default headers. |
| 11512 | * - **`defaults.headers.common`** |
| 11513 | * - **`defaults.headers.post`** |
| 11514 | * - **`defaults.headers.put`** |
| 11515 | * - **`defaults.headers.patch`** |
| 11516 | * |
| 11517 | * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the |
| 11518 | * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the |
| 11519 | * {@link $jsonpCallbacks} service. Defaults to `'callback'`. |
| 11520 | * |
| 11521 | * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function |
| 11522 | * used to the prepare string representation of request parameters (specified as an object). |
| 11523 | * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. |
| 11524 | * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. |
| 11525 | * |
| 11526 | * - **`defaults.transformRequest`** - |
| 11527 | * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` - |
| 11528 | * An array of functions (or a single function) which are applied to the request data. |
| 11529 | * By default, this is an array with one request transformation function: |
| 11530 | * |
| 11531 | * - If the `data` property of the request configuration object contains an object, serialize it |
| 11532 | * into JSON format. |
| 11533 | * |
| 11534 | * - **`defaults.transformResponse`** - |
| 11535 | * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` - |
| 11536 | * An array of functions (or a single function) which are applied to the response data. By default, |
| 11537 | * this is an array which applies one response transformation function that does two things: |
| 11538 | * |
| 11539 | * - If XSRF prefix is detected, strip it |
| 11540 | * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}). |
| 11541 | * - If the `Content-Type` is `application/json` or the response looks like JSON, |
| 11542 | * deserialize it using a JSON parser. |
| 11543 | * |
| 11544 | * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. |
| 11545 | * Defaults value is `'XSRF-TOKEN'`. |
| 11546 | * |
| 11547 | * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the |
| 11548 | * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. |
| 11549 | * |
| 11550 | **/ |
| 11551 | var defaults = this.defaults = { |
| 11552 | // transform incoming response data |
| 11553 | transformResponse: [defaultHttpResponseTransform], |
| 11554 |
nothing calls this directly
no test coverage detected