Browse Source

doc: wrap long lines in http.request

PR-URL: https://github.com/nodejs/node/pull/9584
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
v6.x
Timothy Gu 8 years ago
committed by Myles Borins
parent
commit
b99a9e9a81
  1. 41
      doc/api/http.md

41
doc/api/http.md

@ -1511,34 +1511,37 @@ added: v0.3.6
* `options` {Object} * `options` {Object}
* `protocol` {String} Protocol to use. Defaults to `'http:'`. * `protocol` {String} Protocol to use. Defaults to `'http:'`.
* `host` {String} A domain name or IP address of the server to issue the request to. * `host` {String} A domain name or IP address of the server to issue the
Defaults to `'localhost'`. request to. Defaults to `'localhost'`.
* `hostname` {String} Alias for `host`. To support [`url.parse()`][] `hostname` is * `hostname` {String} Alias for `host`. To support [`url.parse()`][],
preferred over `host`. `hostname` is preferred over `host`.
* `family` {Number} IP address family to use when resolving `host` and `hostname`. * `family` {Number} IP address family to use when resolving `host` and
Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be `hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
used. v6 will be used.
* `port` {Number} Port of remote server. Defaults to 80. * `port` {Number} Port of remote server. Defaults to 80.
* `localAddress` {String} Local interface to bind for network connections. * `localAddress` {String} Local interface to bind for network connections.
* `socketPath` {String} Unix Domain Socket (use one of host:port or socketPath). * `socketPath` {String} Unix Domain Socket (use one of host:port or
* `method` {String} A string specifying the HTTP request method. Defaults to `'GET'`. socketPath).
* `path` {String} Request path. Defaults to `'/'`. Should include query string if any. * `method` {String} A string specifying the HTTP request method. Defaults to
E.G. `'/index.html?page=12'`. An exception is thrown when the request path `'GET'`.
contains illegal characters. Currently, only spaces are rejected but that * `path` {String} Request path. Defaults to `'/'`. Should include query
may change in the future. 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. * `headers` {Object} An object containing request headers.
* `auth` {String} Basic authentication i.e. `'user:password'` to compute an * `auth` {String} Basic authentication i.e. `'user:password'` to compute an
Authorization header. Authorization header.
* `agent` {http.Agent|Boolean} Controls [`Agent`][] behavior. When an Agent is used request will * `agent` {http.Agent|Boolean} Controls [`Agent`][] behavior. When an Agent
default to `Connection: keep-alive`. Possible values: is used request will default to `Connection: keep-alive`. Possible values:
* `undefined` (default): use [`http.globalAgent`][] for this host and port. * `undefined` (default): use [`http.globalAgent`][] for this host and port.
* `Agent` object: explicitly use the passed in `Agent`. * `Agent` object: explicitly use the passed in `Agent`.
* `false`: opts out of connection pooling with an Agent, defaults request to * `false`: opts out of connection pooling with an Agent, defaults request to
`Connection: close`. `Connection: close`.
* `createConnection` {Function} A function that produces a socket/stream to use for the * `createConnection` {Function} A function that produces a socket/stream to
request when the `agent` option is not used. This can be used to avoid use for the request when the `agent` option is not used. This can be used to
creating a custom Agent class just to override the default `createConnection` avoid creating a custom Agent class just to override the default
function. See [`agent.createConnection()`][] for more details. `createConnection` function. See [`agent.createConnection()`][] for more
details.
* `timeout` {Integer}: A number specifying the socket timeout in milliseconds. * `timeout` {Integer}: A number specifying the socket timeout in milliseconds.
This will set the timeout before the socket is connected. This will set the timeout before the socket is connected.
* `callback` {Function} * `callback` {Function}

Loading…
Cancel
Save