From 753fcaa27066b34a99ee1c02b43a32744fc92a3c Mon Sep 17 00:00:00 2001 From: Michal Tehnik Date: Thu, 15 Jan 2015 13:58:31 +0100 Subject: [PATCH] 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 --- doc/api/http.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 3d482b441c80d3..df76a25d66ad23 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) {