From 7afda9086e9f888545bcd9e4b894ef6bde3ee57e Mon Sep 17 00:00:00 2001 From: James Nylen Date: Fri, 7 Nov 2014 17:42:08 -0600 Subject: [PATCH] Clarify that defaults() does not modify global defaults This has come up several times recently, for example #1150 and #1249. --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3be9fad19..8f09a5403 100644 --- a/README.md +++ b/README.md @@ -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