| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1963,44 +1963,44 @@ changes: | |||
| 1963 | 1963 | ||
| 1964 | 1964 | * `url` {string | URL} | |
| 1965 | 1965 | * `options` {Object} | |
| 1966 | - * `protocol` {string} Protocol to use. **Default:** `'http:'`. | ||
| 1966 | + * `agent` {http.Agent | boolean} Controls [`Agent`][] behavior. Possible | ||
| 1967 | + values: | ||
| 1968 | + * `undefined` (default): use [`http.globalAgent`][] for this host and port. | ||
| 1969 | + * `Agent` object: explicitly use the passed in `Agent`. | ||
| 1970 | + * `false`: causes a new `Agent` with default values to be used. | ||
| 1971 | + * `auth` {string} Basic authentication i.e. `'user:password'` to compute an | ||
| 1972 | + Authorization header. | ||
| 1973 | + * `createConnection` {Function} A function that produces a socket/stream to | ||
| 1974 | + use for the request when the `agent` option is not used. This can be used to | ||
| 1975 | + avoid creating a custom `Agent` class just to override the default | ||
| 1976 | + `createConnection` function. See [`agent.createConnection()`][] for more | ||
| 1977 | + details. Any [`Duplex`][] stream is a valid return value. | ||
| 1978 | + * `defaultPort` {number} Default port for the protocol. **Default:** | ||
| 1979 | + `agent.defaultPort` if an `Agent` is used, else `undefined`. | ||
| 1980 | + * `family` {number} IP address family to use when resolving `host` or | ||
| 1981 | + `hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and | ||
| 1982 | + v6 will be used. | ||
| 1983 | + * `headers` {Object} An object containing request headers. | ||
| 1967 | 1984 | * `host` {string} A domain name or IP address of the server to issue the | |
| 1968 | 1985 | request to. **Default:** `'localhost'`. | |
| 1969 | 1986 | * `hostname` {string} Alias for `host`. To support [`url.parse()`][], | |
| 1970 | 1987 | `hostname` will be used if both `host` and `hostname` are specified. | |
| 1971 | - * `family` {number} IP address family to use when resolving `host` or | ||
| 1972 | - `hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and | ||
| 1973 | - v6 will be used. | ||
| 1974 | - * `defaultPort` {number} Default port for the protocol. **Default:** | ||
| 1975 | - `agent.defaultPort` if an `Agent` is used, else `undefined`. | ||
| 1976 | - * `port` {number} Port of remote server. **Default:** `defaultPort` if set, | ||
| 1977 | - else `80`. | ||
| 1978 | 1988 | * `localAddress` {string} Local interface to bind for network connections. | |
| 1979 | - * `socketPath` {string} Unix Domain Socket (cannot be used if one of `host` | ||
| 1980 | - or `port` is specified, those specify a TCP Socket). | ||
| 1981 | 1989 | * `method` {string} A string specifying the HTTP request method. **Default:** | |
| 1982 | 1990 | `'GET'`. | |
| 1983 | 1991 | * `path` {string} Request path. Should include query string if any. | |
| 1984 | 1992 | E.G. `'/index.html?page=12'`. An exception is thrown when the request path | |
| 1985 | 1993 | contains illegal characters. Currently, only spaces are rejected but that | |
| 1986 | 1994 | may change in the future. **Default:** `'/'`. | |
| 1987 | - * `headers` {Object} An object containing request headers. | ||
| 1988 | - * `auth` {string} Basic authentication i.e. `'user:password'` to compute an | ||
| 1989 | - Authorization header. | ||
| 1990 | - * `agent` {http.Agent | boolean} Controls [`Agent`][] behavior. Possible | ||
| 1991 | - values: | ||
| 1992 | - * `undefined` (default): use [`http.globalAgent`][] for this host and port. | ||
| 1993 | - * `Agent` object: explicitly use the passed in `Agent`. | ||
| 1994 | - * `false`: causes a new `Agent` with default values to be used. | ||
| 1995 | - * `createConnection` {Function} A function that produces a socket/stream to | ||
| 1996 | - use for the request when the `agent` option is not used. This can be used to | ||
| 1997 | - avoid creating a custom `Agent` class just to override the default | ||
| 1998 | - `createConnection` function. See [`agent.createConnection()`][] for more | ||
| 1999 | - details. Any [`Duplex`][] stream is a valid return value. | ||
| 2000 | - * `timeout` {number}: A number specifying the socket timeout in milliseconds. | ||
| 2001 | - This will set the timeout before the socket is connected. | ||
| 1995 | + * `port` {number} Port of remote server. **Default:** `defaultPort` if set, | ||
| 1996 | + else `80`. | ||
| 1997 | + * `protocol` {string} Protocol to use. **Default:** `'http:'`. | ||
| 2002 | 1998 | * `setHost` {boolean}: Specifies whether or not to automatically add the | |
| 2003 | 1999 | `Host` header. Defaults to `true`. | |
| 2000 | + * `socketPath` {string} Unix Domain Socket (cannot be used if one of `host` | ||
| 2001 | + or `port` is specified, those specify a TCP Socket). | ||
| 2002 | + * `timeout` {number}: A number specifying the socket timeout in milliseconds. | ||
| 2003 | + This will set the timeout before the socket is connected. | ||
| 2004 | 2004 | * `callback` {Function} | |
| 2005 | 2005 | * Returns: {http.ClientRequest} | |
| 2006 | 2006 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments