summaryrefslogtreecommitdiff
path: root/lib/http.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http.js')
-rw-r--r--lib/http.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/http.js b/lib/http.js
index ad1e71baeb..f41b94d45c 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -1606,9 +1606,7 @@ exports._connectionListener = connectionListener;
// Legacy Interface
function Client(port, host) {
- // TODO http.Client can be removed in v0.9. Until then leave this message.
- util._deprecationWarning('http', 'http.Client is a legacy interface' +
- ' and will be removed in the near future. Do not use it.');
+ if (!(this instanceof Client)) return new Client(port, host);
host = host || 'localhost';
port = port || 80;
this.host = host;
@@ -1646,6 +1644,11 @@ Client.prototype.request = function(method, path, headers) {
};
exports.Client = Client;
+
+// TODO http.Client can be removed in v0.9. Until then leave this message.
+module.deprecate('Client', 'It will be removed in the near future. Do not use it.');
+
exports.createClient = function(port, host) {
return new Client(port, host);
};
+module.deprecate('createClient', 'Use `http.request` instead.');