Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 6671efa

Browse files
hidekiyjasnell
authored andcommitted
Fix improper sample code in http.markdown
You must consume the data from the response object. #8443 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: #25471
1 parent f9d783a commit 6671efa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/http.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ Example:
568568

569569
http.get("http://www.google.com/index.html", function(res) {
570570
console.log("Got response: " + res.statusCode);
571+
// consume response body
572+
res.resume();
571573
}).on('error', function(e) {
572574
console.log("Got error: " + e.message);
573575
});

0 commit comments

Comments
 (0)