@@ -266,12 +266,6 @@ function $HttpProvider() {
266266 * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses
267267 * by default. See {@link $http#caching $http Caching} for more information.
268268 *
269- * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
270- * Defaults value is `'XSRF-TOKEN'`.
271- *
272- * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
273- * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
274- *
275269 * - **`defaults.headers`** - {Object} - Default headers for all $http requests.
276270 * Refer to {@link ng.$http#setting-http-headers $http} for documentation on
277271 * setting default headers.
@@ -280,15 +274,38 @@ function $HttpProvider() {
280274 * - **`defaults.headers.put`**
281275 * - **`defaults.headers.patch`**
282276 *
277+ * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the
278+ * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the
279+ * {@link $jsonpCallbacks} service. Defaults to `'callback'`.
283280 *
284281 * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function
285282 * used to the prepare string representation of request parameters (specified as an object).
286283 * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.
287284 * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.
288285 *
289- * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the
290- * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the
291- * {@link $jsonpCallbacks} service. Defaults to `'callback'`.
286+ * - **`defaults.transformRequest`** -
287+ * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` -
288+ * An array of functions (or a single function) which are applied to the request data.
289+ * By default, this is an array with one request transformation function:
290+ *
291+ * - If the `data` property of the request configuration object contains an object, serialize it
292+ * into JSON format.
293+ *
294+ * - **`defaults.transformResponse`** -
295+ * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` -
296+ * An array of functions (or a single function) which are applied to the response data. By default,
297+ * this is an array which applies one response transformation function that does two things:
298+ *
299+ * - If XSRF prefix is detected, strip it
300+ * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).
301+ * - If the `Content-Type` is `application/json` or the response looks like JSON,
302+ * deserialize it using a JSON parser.
303+ *
304+ * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
305+ * Defaults value is `'XSRF-TOKEN'`.
306+ *
307+ * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
308+ * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
292309 *
293310 **/
294311 var defaults = this . defaults = {
@@ -552,15 +569,18 @@ function $HttpProvider() {
552569 *
553570 * AngularJS provides the following default transformations:
554571 *
555- * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):
572+ * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is
573+ * an array with one function that does the following:
556574 *
557575 * - If the `data` property of the request configuration object contains an object, serialize it
558576 * into JSON format.
559577 *
560- * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):
578+ * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is
579+ * an array with one function that does the following:
561580 *
562581 * - If XSRF prefix is detected, strip it (see Security Considerations section below).
563- * - If JSON response is detected, deserialize it using a JSON parser.
582+ * - If the `Content-Type` is `application/json` or the response looks like JSON,
583+ * deserialize it using a JSON parser.
564584 *
565585 *
566586 * ### Overriding the Default Transformations Per Request
0 commit comments