summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Marier <francois@mozilla.com>2012-10-29 16:16:40 +1300
committerBen Noordhuis <info@bnoordhuis.nl>2012-10-29 20:34:03 +0100
commit326bce91d680ccf4a263f6c8696865cc800412d0 (patch)
tree2fe8a2f3ad4a7ec349e86ffce65874b2a049eb33
parent5f0a10ad218e56f1ebbcbf59702d0759c12b19c9 (diff)
downloadnode-326bce91d680ccf4a263f6c8696865cc800412d0.tar.gz
doc: reflect hostname v. host preference in examples
The documentation for http.request and https.request states that `hostname` is preferred over `host` so the code examples should use that option name.
-rw-r--r--doc/api/http.markdown8
-rw-r--r--doc/api/https.markdown6
2 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
index e8bf483f0..59a9f8a30 100644
--- a/doc/api/http.markdown
+++ b/doc/api/http.markdown
@@ -505,7 +505,7 @@ upload a file with a POST request, then write to the `ClientRequest` object.
Example:
var options = {
- host: 'www.google.com',
+ hostname: 'www.google.com',
port: 80,
path: '/upload',
method: 'POST'
@@ -594,7 +594,7 @@ pool you can do something along the lines of:
Alternatively, you could just opt out of pooling entirely using `agent:false`:
- http.get({host:'localhost', port:80, path:'/', agent:false}, function (res) {
+ http.get({hostname:'localhost', port:80, path:'/', agent:false}, function (res) {
// Do stuff
})
@@ -719,7 +719,7 @@ A client server pair that show you how to listen for the `connect` event.
// make a request to a tunneling proxy
var options = {
port: 1337,
- host: '127.0.0.1',
+ hostname: '127.0.0.1',
method: 'CONNECT',
path: 'www.google.com:80'
};
@@ -776,7 +776,7 @@ A client server pair that show you how to listen for the `upgrade` event.
// make a request
var options = {
port: 1337,
- host: '127.0.0.1',
+ hostname: '127.0.0.1',
headers: {
'Connection': 'Upgrade',
'Upgrade': 'websocket'
diff --git a/doc/api/https.markdown b/doc/api/https.markdown
index f91948e59..090e22947 100644
--- a/doc/api/https.markdown
+++ b/doc/api/https.markdown
@@ -71,7 +71,7 @@ Example:
var https = require('https');
var options = {
- host: 'encrypted.google.com',
+ hostname: 'encrypted.google.com',
port: 443,
path: '/',
method: 'GET'
@@ -137,7 +137,7 @@ In order to specify these options, use a custom `Agent`.
Example:
var options = {
- host: 'encrypted.google.com',
+ hostname: 'encrypted.google.com',
port: 443,
path: '/',
method: 'GET',
@@ -155,7 +155,7 @@ Or does not use an `Agent`.
Example:
var options = {
- host: 'encrypted.google.com',
+ hostname: 'encrypted.google.com',
port: 443,
path: '/',
method: 'GET',