mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Add specialized overloads for request events
This commit is contained in:
@@ -640,3 +640,15 @@ request({url: 'http://www.google.com', jar: j}, function () {
|
||||
var cookies = j.getCookies(url);
|
||||
// [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...]
|
||||
});
|
||||
|
||||
request(
|
||||
{ method: 'GET'
|
||||
, uri: 'http://www.google.com'
|
||||
, gzip: true
|
||||
}
|
||||
)
|
||||
.on('request', function(req: http.ClientRequest) { })
|
||||
.on('response', function(resp: http.IncomingMessage) { })
|
||||
.on('data', function(data: Buffer | string) { })
|
||||
.on('error', function(e: Error) { })
|
||||
.on('complete', function(resp: http.IncomingMessage, body?: string | Buffer) { });
|
||||
Reference in New Issue
Block a user