mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 23:34:42 +00:00
docs($http): fix adding default header to get request example
Initially, `$httpProvider.defaults.headers.get` is `undefined`, so `$httpProvider.defaults.headers.get['My-Header']='value'` will throw an error. Closes #4101
This commit is contained in:
parent
ec6b1cfaba
commit
7e5154e755
1 changed files with 1 additions and 1 deletions
|
|
@ -251,7 +251,7 @@ function $HttpProvider() {
|
||||||
* To add or overwrite these defaults, simply add or remove a property from these configuration
|
* To add or overwrite these defaults, simply add or remove a property from these configuration
|
||||||
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
|
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
|
||||||
* with the lowercased HTTP method name as the key, e.g.
|
* with the lowercased HTTP method name as the key, e.g.
|
||||||
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
|
* `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
|
||||||
*
|
*
|
||||||
* Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same
|
* Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same
|
||||||
* fashion.
|
* fashion.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue