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:
Michal Tehnik 2015-01-15 13:58:31 +01:00 committed by Ben Noordhuis
parent 8440cacb10
commit 753fcaa270

View File

@ -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) {