mikeal/request — pull request #890 by brooklynDev (2014-05-06 14:47:07+00:00)
Title: Allow recursive request.defaults

This change allows you to call `request.defaults` on the function that is returned from a call to `request.defaults`

The idea is to be able to recursively call `.defaults` to override or add new configs to the previous defaults.

For example
````
var proxiedRequest = request.defaults({proxy: "http://proxy1.com"});
var nonRedirectedProxyRequest = proxiedRequest.defaults({followRedirect: false});
````
In this example `proxiedRequest` would just have the `proxy` as the default and `nonRedirectedProxyRequest` would have both the `proxy` and `followRedirects` as defaults.

You can also do something like
```
var r1 = request.defaults({
timeout: 1000,
followRedirect: false
});
var r2 = r1.defaults({timeout: 3000});
```
in which case `r1` would not follow redirects and have a timeout of 1000ms and `r2` would also not follow redirects but would have a timeout of 3000ms