Skip to content

Commit 7097eca

Browse files
Kip Gebhardtkoichik
authored andcommitted
Adding documentation for 'agent' option in http.request().
Fixes #1243.
1 parent 5208abe commit 7097eca

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

doc/api/http.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ Options:
393393
- `path`: Request path. Should include query string and fragments if any.
394394
E.G. `'/index.html?page=12'`
395395
- `headers`: An object containing request headers.
396+
- `agent`: Controls `Agent` behavior. Possible values:
397+
- `undefined` (default): use default `Agent` for this host and port.
398+
- `Agent` object: explicitly use the passed in `Agent`.
399+
- `false`: explicitly generate a new `Agent` for this host and port. `Agent` will not be re-used.
396400

397401
`http.request()` returns an instance of the `http.ClientRequest`
398402
class. The `ClientRequest` instance is a writable stream. If one needs to

0 commit comments

Comments
 (0)