MCPcopy
hub / github.com/angular-ui/ui-router / $HttpProvider

Function $HttpProvider

test/angular/1.6/angular.js:11568–12839  ·  view source on GitHub ↗

* @ngdoc provider * @name $httpProvider * @this * * @description * Use `$httpProvider` to change the default behavior of the ng.$http $http service.

()

Source from the content-addressed store, hash-verified

11566 * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.
11567 */
11568function $HttpProvider() {
11569 /**
11570 * @ngdoc property
11571 * @name $httpProvider#defaults
11572 * @description
11573 *
11574 * Object containing default values for all {@link ng.$http $http} requests.
11575 *
11576 * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with
11577 * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses
11578 * by default. See {@link $http#caching $http Caching} for more information.
11579 *
11580 * - **`defaults.headers`** - {Object} - Default headers for all $http requests.
11581 * Refer to {@link ng.$http#setting-http-headers $http} for documentation on
11582 * setting default headers.
11583 * - **`defaults.headers.common`**
11584 * - **`defaults.headers.post`**
11585 * - **`defaults.headers.put`**
11586 * - **`defaults.headers.patch`**
11587 *
11588 * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the
11589 * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the
11590 * {@link $jsonpCallbacks} service. Defaults to `'callback'`.
11591 *
11592 * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function
11593 * used to the prepare string representation of request parameters (specified as an object).
11594 * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.
11595 * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.
11596 *
11597 * - **`defaults.transformRequest`** -
11598 * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` -
11599 * An array of functions (or a single function) which are applied to the request data.
11600 * By default, this is an array with one request transformation function:
11601 *
11602 * - If the `data` property of the request configuration object contains an object, serialize it
11603 * into JSON format.
11604 *
11605 * - **`defaults.transformResponse`** -
11606 * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` -
11607 * An array of functions (or a single function) which are applied to the response data. By default,
11608 * this is an array which applies one response transformation function that does two things:
11609 *
11610 * - If XSRF prefix is detected, strip it
11611 * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).
11612 * - If the `Content-Type` is `application/json` or the response looks like JSON,
11613 * deserialize it using a JSON parser.
11614 *
11615 * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
11616 * Defaults value is `'XSRF-TOKEN'`.
11617 *
11618 * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
11619 * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
11620 *
11621 */
11622 var defaults = this.defaults = {
11623 // transform incoming response data
11624 transformResponse: [defaultHttpResponseTransform],
11625

Callers

nothing calls this directly

Calls 12

isObjectFunction · 0.70
isFileFunction · 0.70
isBlobFunction · 0.70
isFormDataFunction · 0.70
toJsonFunction · 0.70
shallowCopyFunction · 0.70
isDefinedFunction · 0.70
isStringFunction · 0.70
forEachFunction · 0.70
createShortMethodsFunction · 0.70

Tested by

no test coverage detected