Skip to content

Commit

Permalink
doc: fix improper http.get sample code
Browse files Browse the repository at this point in the history
Refs: nodejs/node-v0.x-archive#25471
Refs: nodejs/node-v0.x-archive#8443
PR-URL: #4263
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
hidekiy authored and jasnell committed Dec 14, 2015
1 parent 498c9ad commit c6efd53
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 @@ -966,6 +966,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 c6efd53

Please sign in to comment.