FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix improper sample code in http.markdown · thinred/node@6671efa · GitHub

Repository navigation

Commit 6671efa

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

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎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)

Back | FazBrowse Home | New Git URL