Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkoichik <koichik@improvement.jp>2012-08-18 09:18:02 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-08-24 18:56:06 +0400
commit752ac320ae48d266fdc5d61a3963857b8f343c10 (patch)
treed8121ef8ff5705d6c7e909570a8c74d2f7de6d80 /doc
parent59011448c0c47a1ad374f5b184d2627fc68c06bd (diff)
https: make https.get() accept a URL
https.get() now accepts either a URL (as a string) or an options object. Refs #2859. Fixes #3882.
Diffstat (limited to 'doc')
-rw-r--r--doc/api/https.markdown13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/api/https.markdown b/doc/api/https.markdown
index 5f0052c2c3a..13691d5b3d0 100644
--- a/doc/api/https.markdown
+++ b/doc/api/https.markdown
@@ -48,8 +48,12 @@ Or
## https.request(options, callback)
-Makes a request to a secure web server. All options from [http.request()][]
-are valid.
+Makes a request to a secure web server.
+
+`options` can be an object or a string. If `options` is a string, it is
+automatically parsed with [url.parse()](url.html#url.parse).
+
+All options from [http.request()][] are valid.
Example:
@@ -157,11 +161,14 @@ Example:
Like `http.get()` but for HTTPS.
+`options` can be an object or a string. If `options` is a string, it is
+automatically parsed with [url.parse()](url.html#url.parse).
+
Example:
var https = require('https');
- https.get({ host: 'encrypted.google.com', path: '/' }, function(res) {
+ https.get('https://encrypted.google.com/' }, function(res) {
console.log("statusCode: ", res.statusCode);
console.log("headers: ", res.headers);