mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: fix improper http.get sample code
Refs: https://github.com/nodejs/node-v0.x-archive/pull/25471 Refs: https://github.com/nodejs/node-v0.x-archive/issues/8443 PR-URL: https://github.com/nodejs/node/pull/4263 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
903867edc4
commit
b9ce3ebf45
1 file changed
+2
@@ -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);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user