Skip to content

Instantly share code, notes, and snippets.

@handlename
Created November 12, 2011 04:54
Show Gist options
  • Save handlename/1360062 to your computer and use it in GitHub Desktop.
Save handlename/1360062 to your computer and use it in GitHub Desktop.
var http = require("http");
http.get({
host: "example.com",
port: 80,
path: "/"
}, function(res) {
var text = "";
res.setEncoding("utf8");
res.on("data", function(chunk) {
text += chunk.toString();
});
res.on("end", function() {
console.log(text);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment