|
@ -210,11 +210,6 @@ function IncomingMessage (socket) { |
|
|
util.inherits(IncomingMessage, stream.Stream); |
|
|
util.inherits(IncomingMessage, stream.Stream); |
|
|
exports.IncomingMessage = IncomingMessage; |
|
|
exports.IncomingMessage = IncomingMessage; |
|
|
|
|
|
|
|
|
IncomingMessage.prototype._parseQueryString = function () { |
|
|
|
|
|
throw new Error("_parseQueryString is deprecated. Use require(\"querystring\") to parse query strings.\n"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IncomingMessage.prototype.setEncoding = function (encoding) { |
|
|
IncomingMessage.prototype.setEncoding = function (encoding) { |
|
|
var StringDecoder = require("string_decoder").StringDecoder; // lazy load
|
|
|
var StringDecoder = require("string_decoder").StringDecoder; // lazy load
|
|
|
this._decoder = new StringDecoder(encoding); |
|
|
this._decoder = new StringDecoder(encoding); |
|
@ -469,12 +464,6 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutgoingMessage.prototype.sendBody = function () { |
|
|
|
|
|
throw new Error("sendBody() has been renamed to write(). "); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutgoingMessage.prototype.write = function (chunk, encoding) { |
|
|
OutgoingMessage.prototype.write = function (chunk, encoding) { |
|
|
if (!this._header) { |
|
|
if (!this._header) { |
|
|
throw new Error("You have to call writeHead() before write()"); |
|
|
throw new Error("You have to call writeHead() before write()"); |
|
@ -680,24 +669,6 @@ function ClientRequest (socket, method, url, headers) { |
|
|
util.inherits(ClientRequest, OutgoingMessage); |
|
|
util.inherits(ClientRequest, OutgoingMessage); |
|
|
exports.ClientRequest = ClientRequest; |
|
|
exports.ClientRequest = ClientRequest; |
|
|
|
|
|
|
|
|
ClientRequest.prototype.finish = function () { |
|
|
|
|
|
throw new Error( "finish() has been renamed to end() and no longer takes " |
|
|
|
|
|
+ "a response handler as an argument. Manually add a 'response' listener " |
|
|
|
|
|
+ "to the request object." |
|
|
|
|
|
); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClientRequest.prototype.end = function () { |
|
|
|
|
|
if (typeof arguments[0] == "function") { |
|
|
|
|
|
throw new Error( "ClientRequest.prototype.end does not take a callback. " |
|
|
|
|
|
+ "Add a 'response' listener manually to get the response." |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
OutgoingMessage.prototype.end.apply(this, arguments); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function outgoingFlush (socket) { |
|
|
function outgoingFlush (socket) { |
|
|
// This logic is probably a bit confusing. Let me explain a bit:
|
|
|
// This logic is probably a bit confusing. Let me explain a bit:
|
|
|
//
|
|
|
//
|
|
@ -1059,27 +1030,6 @@ Client.prototype._reconnect = function () { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.get = function () { |
|
|
|
|
|
throw new Error("client.get(...) is now client.request('GET', ...)"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.head = function () { |
|
|
|
|
|
throw new Error("client.head(...) is now client.request('HEAD', ...)"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.post = function () { |
|
|
|
|
|
throw new Error("client.post(...) is now client.request('POST', ...)"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.del = function () { |
|
|
|
|
|
throw new Error("client.del(...) is now client.request('DELETE', ...)"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.put = function () { |
|
|
|
|
|
throw new Error("client.put(...) is now client.request('PUT', ...)"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Client.prototype.request = function (method, url, headers) { |
|
|
Client.prototype.request = function (method, url, headers) { |
|
|
if (typeof(url) != "string") { |
|
|
if (typeof(url) != "string") { |
|
|
// assume method was omitted, shift arguments
|
|
|
// assume method was omitted, shift arguments
|
|
|