var http = require('http'); http.get("http://www.google.com/", function(res) { console.log("Got response: " + res.statusCode); res.on('data', function(buffer) { console.log(buffer.toString('utf-8', 0, 500)); }); }).on('error', function(e) { console.log("got error: " + e.message); });