Skip to content

Commit

Permalink
doc: extend example of http.request by end event
Browse files Browse the repository at this point in the history
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: #447
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
MicTech authored and bnoordhuis committed Jan 15, 2015
1 parent 8440cac commit 753fcaa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 753fcaa

Please sign in to comment.