Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas committed Mar 4, 2015
1 parent 00498fa commit 1015217
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ All of Needle's request methods return a Readable stream, and both `options` and

```js
var options = {
timeout: 5000 // if we don't get a response in 5 seconds, boom.
open_timeout: 5000 // if we don't get a response in 5 seconds, boom.
}

needle.head('https://my.backend.server.com', function(err, resp) {
Expand Down Expand Up @@ -261,10 +261,13 @@ Overriding Defaults
Yes sir, we have it. Needle includes a `defaults()` method, that lets you override some of the defaults for all future requests. Like this:

```js
needle.defaults({ timeout: 60000, user_agent: 'MyApp/1.2.3' });
needle.defaults({
open_timeout: 60000,
user_agent: 'MyApp/1.2.3',
parse_response: false });
```

This will override Needle's default user agent and 10-second timeout, so you don't need to pass those options in every other request.
This will override Needle's default user agent and 10-second timeout, and disable response parsing, so you don't need to pass those options in every other request.

Examples Galore
---------------
Expand Down

0 comments on commit 1015217

Please sign in to comment.