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:
parent
498c9adb08
commit
c6efd535e4
@ -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);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user