Skip to content

Commit

Permalink
Removed deprecated methods from lib/http.js
Browse files Browse the repository at this point in the history
  • Loading branch information
miksago authored and ry committed Oct 11, 2010
1 parent 7bfefb5 commit 0e1a581
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@ function IncomingMessage (socket) {
util.inherits(IncomingMessage, stream.Stream);
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) {
var StringDecoder = require("string_decoder").StringDecoder; // lazy load
this._decoder = new StringDecoder(encoding);
Expand Down Expand Up @@ -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) {
if (!this._header) {
throw new Error("You have to call writeHead() before write()");
Expand Down Expand Up @@ -680,24 +669,6 @@ function ClientRequest (socket, method, url, headers) {
util.inherits(ClientRequest, OutgoingMessage);
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) {
// This logic is probably a bit confusing. Let me explain a bit:
//
Expand Down Expand Up @@ -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) {
if (typeof(url) != "string") {
// assume method was omitted, shift arguments
Expand Down

0 comments on commit 0e1a581

Please sign in to comment.