Skip to content

Commit

Permalink
add a readme section
Browse files Browse the repository at this point in the history
  • Loading branch information
pwmckenna committed Aug 1, 2018
1 parent 93851fb commit 3397bd6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ request({
});
```

## How to extend the default request

```javascript
request.Request = class extends request.Request {
constructor(url, options, f, retryConfig) {
super(url, options, f, retryConfig);
// this constructor will be called for every requestretry call,
// and give you global logging
console.log('Request', url, options, f, retryConfig);
}
}
```


## Modifying `request` options

You can use the `defaults` method to provide default options like so:
Expand Down

0 comments on commit 3397bd6

Please sign in to comment.