doc: extend example of http.request by end event
Added .on('end', callback) event to http.request example, because for first sight it's not clear from http documentation, how to handle end of request. PR-URL: https://github.com/iojs/io.js/pull/447 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
8440cacb10
commit
753fcaa270
@ -514,6 +514,9 @@ Example:
|
||||
res.on('data', function (chunk) {
|
||||
console.log('BODY: ' + chunk);
|
||||
});
|
||||
res.on('end', function() {
|
||||
console.log('No more data in response.')
|
||||
})
|
||||
});
|
||||
|
||||
req.on('error', function(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user