diff options
author | Michal Tehnik <michal.tehnik@mictech.cz> | 2015-01-15 15:58:31 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-15 19:40:24 +0300 |
commit | 753fcaa27066b34a99ee1c02b43a32744fc92a3c (patch) | |
tree | 25cfea16d2ba5f64c2c9461229564e6c3dafc70d /doc | |
parent | 8440cacb100ae83c2b2c02e82a87c73a66380c21 (diff) |
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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/http.markdown | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 3d482b441c8..df76a25d66a 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -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) { |