Skip to content

Commit

Permalink
Clarify that defaults() does not modify global defaults
Browse files Browse the repository at this point in the history
This has come up several times recently, for example #1150 and #1249.
  • Loading branch information
nylen committed Nov 7, 2014
1 parent c456b71 commit 7afda90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -560,9 +560,14 @@ There are also shorthand methods for different HTTP METHODs and some other conve
### request.defaults(options)
This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.
This method **returns a wrapper** around the normal request API that defaults
to whatever options you pass to it.
**Note:** You can call `.defaults()` on the wrapper that is returned from `request.defaults` to add/override defaults that were previously defaulted.
**Note:** `request.defaults()` **does not** modify the global request API;
instead, it **returns a wrapper** that has your default settings applied to it.
**Note:** You can call `.defaults()` on the wrapper that is returned from
`request.defaults` to add/override defaults that were previously defaulted.
For example:
```javascript
Expand Down

0 comments on commit 7afda90

Please sign in to comment.