Skip to content

Instantly share code, notes, and snippets.

@technoweenie
Created February 24, 2010 04:54
Show Gist options
  • Save technoweenie/313114 to your computer and use it in GitHub Desktop.
Save technoweenie/313114 to your computer and use it in GitHub Desktop.
var sys = require("sys"),
http = require("http");
var google = http.createClient(80, "www.google.com");
var request = google.request("GET", "/", {"host": "www.google.com"});
request.finish(function (response) {
response.setBodyEncoding("utf8");
//setTimeout(function() {
response.addListener("body", function (chunk) {
sys.puts("BODY: " + chunk);
});
//}, 2000)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment