@@ -291,7 +291,15 @@ function $HttpProvider() {
291
291
* `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
292
292
*
293
293
* The defaults can also be set at runtime via the `$http.defaults` object in the same
294
- * fashion. In addition, you can supply a `headers` property in the config object passed when
294
+ * fashion. For example:
295
+ *
296
+ * ```
297
+ * module.run(function($http) {
298
+ * $http.defaults.headers.common.Authentication = 'Basic YmVlcDpib29w'
299
+ * });
300
+ * ```
301
+ *
302
+ * In addition, you can supply a `headers` property in the config object passed when
295
303
* calling `$http(config)`, which overrides the defaults without changing them globally.
296
304
*
297
305
*
@@ -315,7 +323,9 @@ function $HttpProvider() {
315
323
* properties. These properties are by default an array of transform functions, which allows you
316
324
* to `push` or `unshift` a new transformation function into the transformation chain. You can
317
325
* also decide to completely override any default transformations by assigning your
318
- * transformation functions to these properties directly without the array wrapper.
326
+ * transformation functions to these properties directly without the array wrapper. These defaults
327
+ * are again available on the $http factory at run-time, which may be useful if you have run-time
328
+ * services you wish to be involved in your transformations.
319
329
*
320
330
* Similarly, to locally override the request/response transforms, augment the
321
331
* `transformRequest` and/or `transformResponse` properties of the configuration object passed
@@ -529,7 +539,8 @@ function $HttpProvider() {
529
539
* for added security.
530
540
*
531
541
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
532
- * properties of either $httpProvider.defaults, or the per-request config object.
542
+ * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
543
+ * or the per-request config object.
533
544
*
534
545
*
535
546
* @param {object } config Object describing the request to be made and how it should be
0 commit comments