diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-01-21 13:21:01 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-01-21 13:21:01 -0800 |
commit | db8736ad93231986b747e21131719fdacdf39a02 (patch) | |
tree | 5d93629b693b9dd7b021bcf994d016d197ea0e46 /lib/https.js | |
parent | e65f6b4ce1246fa32a30d4041f568acb93c7ca24 (diff) | |
download | android-node-v8-db8736ad93231986b747e21131719fdacdf39a02.tar.gz android-node-v8-db8736ad93231986b747e21131719fdacdf39a02.tar.bz2 android-node-v8-db8736ad93231986b747e21131719fdacdf39a02.zip |
Add https.get()
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js index e2555f0017..aaa070a7aa 100644 --- a/lib/https.js +++ b/lib/https.js @@ -44,6 +44,8 @@ Agent.prototype._getConnection = function(host, port, cb) { function getAgent(options) { + if (!options.port) options.port = 443; + var id = options.host + ':' + options.port; var agent = agents[id]; @@ -59,3 +61,11 @@ exports.request = function(options, cb) { var agent = getAgent(options); return http._requestFromAgent(agent, options, cb); }; + + +exports.get = function(options, cb) { + options.method = 'GET'; + var req = exports.request(options, cb); + req.end(); + return req; +}; |