Skip to content

Instantly share code, notes, and snippets.

@linus-amg
Created June 10, 2015 17:23
Show Gist options
  • Save linus-amg/f66cbf78175c693bfa75 to your computer and use it in GitHub Desktop.
Save linus-amg/f66cbf78175c693bfa75 to your computer and use it in GitHub Desktop.
var http = require('http');
var request = http.get({
url: '/',
headers: {
cookie: 'session.id=...'
}
}, function(res) {
var data = '';
res.on('data', function(chunk) {
data += chunk;
});
res.on('end', function() {
console.log('done', data.toString());
});
});
request.on('error', function(err) {
console.error(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment