@ -594,32 +594,33 @@ exports.createClient = function (port, host) {
return client ;
} ;
process . http . Client . prototype . get = function ( uri , headers ) {
var req = new ClientRequest ( "GET" , uri , headers ) ;
this . _ pushRequest ( req ) ;
return req ;
process . http . Client . prototype . get = function ( ) {
throw new Error ( "client.get(...) is now client.request('GET', ...)" ) ;
} ;
process . http . Client . prototype . head = function ( uri , headers ) {
var req = new ClientRequest ( "HEAD" , uri , headers ) ;
this . _ pushRequest ( req ) ;
return req ;
process . http . Client . prototype . head = function ( ) {
throw new Error ( "client.head(...) is now client.request('HEAD', ...)" ) ;
} ;
process . http . Client . prototype . post = function ( uri , headers ) {
var req = new ClientRequest ( "POST" , uri , headers ) ;
this . _ pushRequest ( req ) ;
return req ;
process . http . Client . prototype . post = function ( ) {
throw new Error ( "client.post(...) is now client.request('POST', ...)" ) ;
} ;
process . http . Client . prototype . del = function ( uri , headers ) {
var req = new ClientRequest ( "DELETE" , uri , headers ) ;
this . _ pushRequest ( req ) ;
return req ;
process . http . Client . prototype . del = function ( ) {
throw new Error ( "client.del(...) is now client.request('DELETE', ...)" ) ;
} ;
process . http . Client . prototype . put = function ( uri , headers ) {
var req = new ClientRequest ( "PUT" , uri , headers ) ;
process . http . Client . prototype . put = function ( ) {
throw new Error ( "client.put(...) is now client.request('PUT', ...)" ) ;
} ;
process . http . Client . prototype . request = function ( method , uri , headers ) {
if ( typeof ( uri ) != "string" ) { // assume method was omitted, shift arguments
headers = uri ;
uri = method ;
method = null ;
}
var req = new ClientRequest ( method || "GET" , uri , headers ) ;
this . _ pushRequest ( req ) ;
return req ;
} ;
@ -637,7 +638,7 @@ exports.cat = function (url, encoding, headers) {
}
var client = exports . createClient ( uri . port || 80 , uri . host ) ;
var req = client . ge t( uri . path || "/" , headers ) ;
var req = client . reques t( uri . path || "/" , headers ) ;
client . addListener ( "error" , function ( ) {
promise . emitError ( ) ;