From 6671efa666464e28adff96bc7bc982967db87c9d Mon Sep 17 00:00:00 2001 From: Hideki Yamamura Date: Tue, 2 Jun 2015 22:30:48 +0900 Subject: [PATCH] Fix improper sample code in http.markdown You must consume the data from the response object. #8443 Reviewed-By: James M Snell PR-URL: https://github.com/joyent/node/pull/25471 --- doc/api/http.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 9d96c9da455a..98da286460c0 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -568,6 +568,8 @@ Example: http.get("http://www.google.com/index.html", function(res) { console.log("Got response: " + res.statusCode); + // consume response body + res.resume(); }).on('error', function(e) { console.log("Got error: " + e.message); });