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

Commit

Permalink
Fix improper sample code in http.markdown
Browse files Browse the repository at this point in the history
You must consume the data from the response object. #8443

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25471
  • Loading branch information
hidekiy authored and jasnell committed Jun 5, 2015
1 parent f9d783a commit 6671efa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 6671efa

Please sign in to comment.