Skip to content

Commit 3397bd6

Browse files
committed
add a readme section
1 parent 93851fb commit 3397bd6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ request({
182182
});
183183
```
184184

185+
## How to extend the default request
186+
187+
```javascript
188+
request.Request = class extends request.Request {
189+
constructor(url, options, f, retryConfig) {
190+
super(url, options, f, retryConfig);
191+
// this constructor will be called for every requestretry call,
192+
// and give you global logging
193+
console.log('Request', url, options, f, retryConfig);
194+
}
195+
}
196+
```
197+
198+
185199
## Modifying `request` options
186200

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

0 commit comments

Comments
 (0)