Skip to content

Instantly share code, notes, and snippets.

@ncb000gt
Created March 10, 2011 18:43
Show Gist options
  • Select an option

  • Save ncb000gt/864630 to your computer and use it in GitHub Desktop.

Select an option

Save ncb000gt/864630 to your computer and use it in GitHub Desktop.
Node 0.4.x get example (from docs)
var http = require('http');
var options = {
host: 'www.google.com',
port: 80,
path: '/index.html'
};
http.get(options, function(res) {
console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment