Skip to content

Instantly share code, notes, and snippets.

@willm
Created June 19, 2012 20:25
Show Gist options
  • Save willm/2956336 to your computer and use it in GitHub Desktop.
Save willm/2956336 to your computer and use it in GitHub Desktop.
make web request in node
var http = require('http');
var req = http.request({host:'www.google.com',port:80,method: 'GET'},
function(res){
console.log('Status Code : %s', res.statusCode);
res.setEncoding('utf8');
res.on('data', function(chunk){
console.log(chunk);
});
});
req.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment