Created
June 10, 2015 17:23
-
-
Save linus-amg/f66cbf78175c693bfa75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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