diff --git a/doc/api/http.markdown b/doc/api/http.markdown index bc7bbb3f93..7d5b9b5215 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -387,11 +387,14 @@ followed by `response.end()`. ## http.request(options, callback) Node maintains several connections per server to make HTTP requests. -This function allows one to transparently issue requests. +This function allows one to transparently issue requests. Options align +with `url.parse`. Options: - `host`: A domain name or IP address of the server to issue the request to. +- `hostname`: To support `url.parse` `hostname` is prefered over + `host` - `port`: Port of remote server. - `socketPath`: Unix Domain Socket (use one of host:port or socketPath) - `method`: A string specifying the HTTP request method. Possible values: @@ -399,6 +402,8 @@ Options: - `path`: Request path. Should include query string and fragments if any. E.G. `'/index.html?page=12'` - `headers`: An object containing request headers. +- `auth`: Basic authentication i.e. `'user:password'` to compute an + Authorization header. - `agent`: Controls `Agent` behavior. When an Agent is used request will default to Connection:keep-alive. Possible values: - `undefined` (default): use default `Agent` for this host and port. @@ -456,6 +461,9 @@ There are a few special headers that should be noted. and listen for the `continue` event. See RFC2616 Section 8.2.3 for more information. +* Sending an Authorization header will override useing the `auth` option + to compute basic authentication. + ## http.get(options, callback) Since most requests are GET requests without bodies, Node provides this diff --git a/doc/api/https.markdown b/doc/api/https.markdown index be21af6458..7a5473cf84 100644 --- a/doc/api/https.markdown +++ b/doc/api/https.markdown @@ -34,7 +34,7 @@ Example: ## https.request(options, callback) Makes a request to a secure web server. -Similar options to `http.request()`. +All options from [`http.request()`](http.html#http.request) are valid. Example: diff --git a/doc/api/url.markdown b/doc/api/url.markdown index 3d188bac45..372dae8083 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -33,6 +33,9 @@ string will not be in the parsed object. Examples are shown for the URL * `search`: The 'query string' portion of the URL, including the leading question mark. Example: `'?query=string'` +* `path`: Concatenation of `pathname` and `search`. + + Example: `'/p/a/t/h?query=string'` * `query`: Either the 'params' portion of the query string, or a querystring-parsed object. Example: `'query=string'` or `{'query':'string'}`