This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* `protocol` {String} Protocol to use. Defaults to `'http:'`.
* `host` {String} A domain name or IP address of the server to issue the request to.
Defaults to `'localhost'`.
* `hostname` {String} Alias for `host`. To support [`url.parse()`][] `hostname` is
preferred over `host`.
* `family` {Number} IP address family to use when resolving `host` and `hostname`.
Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be
used.
* `host` {String} A domain name or IP address of the server to issue the
request to. Defaults to `'localhost'`.
* `hostname` {String} Alias for `host`. To support [`url.parse()`][],
`hostname` is preferred over `host`.
* `family` {Number} IP address family to use when resolving `host` and
`hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
v6 will be used.
* `port` {Number} Port of remote server. Defaults to 80.
* `localAddress` {String} Local interface to bind for network connections.
* `socketPath` {String} Unix Domain Socket (use one of host:port or socketPath).
* `method` {String} A string specifying the HTTP request method. Defaults to `'GET'`.
* `path` {String} Request path. Defaults to `'/'`. Should include query string if any.
E.G. `'/index.html?page=12'`. An exception is thrown when the request path
contains illegal characters. Currently, only spaces are rejected but that
may change in the future.
* `socketPath` {String} Unix Domain Socket (use one of host:port or
socketPath).
* `method` {String} A string specifying the HTTP request method. Defaults to
`'GET'`.
* `path` {String} Request path. Defaults to `'/'`. Should include query
string if any. E.G. `'/index.html?page=12'`. An exception is thrown when
the request path contains illegal characters. Currently, only spaces are
rejected but that may change in the future.
* `headers` {Object} An object containing request headers.
* `auth` {String} Basic authentication i.e. `'user:password'` to compute an
Authorization header.
* `agent` {String} Controls [`Agent`][] behavior. When an Agent is used request will
default to `Connection: keep-alive`. Possible values:
* `agent` {http.Agent|Boolean} Controls [`Agent`][] behavior. When an Agent
is used request will default to `Connection: keep-alive`. Possible values:
* `undefined` (default): use [`http.globalAgent`][] for this host and port.
* `Agent` object: explicitly use the passed in `Agent`.
* `false`: opts out of connection pooling with an Agent, defaults request to
`Connection: close`.
* `createConnection` {Function} A function that produces a socket/stream to use for the
request when the `agent` option is not used. This can be used to avoid
creating a custom Agent class just to override the default `createConnection`
function. See [`agent.createConnection()`][] for more details.
* `createConnection` {Function} A function that produces a socket/stream to
use for the request when the `agent` option is not used. This can be used to
avoid creating a custom Agent class just to override the default
`createConnection` function. See [`agent.createConnection()`][] for more
details.
* `timeout` {Integer}: A number specifying the socket timeout in milliseconds.
This will set the timeout before the socket is connected.
* `callback` {Function}
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
doc: fix type of http.request's agent option #9584
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
doc: fix type of http.request's agent option #9584
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing