diff options
author | seebees <seebees@gmail.com> | 2011-10-19 15:06:49 -0700 |
---|---|---|
committer | koichik <koichik@improvement.jp> | 2011-10-22 14:14:40 +0900 |
commit | a2eaddaa514847aff5557223d9cd2b537d9017eb (patch) | |
tree | 2cbe0cbf8dad2aea3045e9aa050c3c0a512d13f3 /doc | |
parent | 1ead20f27466438600be03af9cc92073e8f44c13 (diff) | |
download | node-a2eaddaa514847aff5557223d9cd2b537d9017eb.tar.gz |
Documentation update
http.markdown
note options now align with url.parse
added note that hostname is preferred over host.
added auth
added not that setting an explicit Authorization header will override basic authentication with 'auth'
https.markdown
Made a link to http.request and noted that all http.request options are valid.
url.markdown
added path option
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/http.markdown | 10 | ||||
-rw-r--r-- | doc/api/https.markdown | 2 | ||||
-rw-r--r-- | doc/api/url.markdown | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/doc/api/http.markdown b/doc/api/http.markdown index bc7bbb3f9..7d5b9b521 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 be21af645..7a5473cf8 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 3d188bac4..372dae808 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'}` |