@ -594,32 +594,33 @@ exports.createClient = function (port, host) {
return client ;
return client ;
} ;
} ;
process . http . Client . prototype . get = function ( uri , headers ) {
process . http . Client . prototype . get = function ( ) {
var req = new ClientRequest ( "GET" , uri , headers ) ;
throw new Error ( "client.get(...) is now client.request('GET', ...)" ) ;
this . _ pushRequest ( req ) ;
return req ;
} ;
} ;
process . http . Client . prototype . head = function ( uri , headers ) {
process . http . Client . prototype . head = function ( ) {
var req = new ClientRequest ( "HEAD" , uri , headers ) ;
throw new Error ( "client.head(...) is now client.request('HEAD', ...)" ) ;
this . _ pushRequest ( req ) ;
return req ;
} ;
} ;
process . http . Client . prototype . post = function ( uri , headers ) {
process . http . Client . prototype . post = function ( ) {
var req = new ClientRequest ( "POST" , uri , headers ) ;
throw new Error ( "client.post(...) is now client.request('POST', ...)" ) ;
this . _ pushRequest ( req ) ;
return req ;
} ;
} ;
process . http . Client . prototype . del = function ( uri , headers ) {
process . http . Client . prototype . del = function ( ) {
var req = new ClientRequest ( "DELETE" , uri , headers ) ;
throw new Error ( "client.del(...) is now client.request('DELETE', ...)" ) ;
this . _ pushRequest ( req ) ;
return req ;
} ;
} ;
process . http . Client . prototype . put = function ( uri , headers ) {
process . http . Client . prototype . put = function ( ) {
var req = new ClientRequest ( "PUT" , uri , headers ) ;
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 ) ;
this . _ pushRequest ( req ) ;
return req ;
return req ;
} ;
} ;
@ -637,7 +638,7 @@ exports.cat = function (url, encoding, headers) {
}
}
var client = exports . createClient ( uri . port || 80 , uri . host ) ;
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 ( ) {
client . addListener ( "error" , function ( ) {
promise . emitError ( ) ;
promise . emitError ( ) ;