Skip to content

Instantly share code, notes, and snippets.

@mape
Created January 3, 2011 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mape/764187 to your computer and use it in GitHub Desktop.
Save mape/764187 to your computer and use it in GitHub Desktop.
Crashes on unstable node.
var http = require('http');
var google = http.createClient(443, 'www.google.com', true);
var request = google.request('GET', '/accounts/AuthSubSessionToken', {'host': 'www.google.com'});
request.end();
request.on('response', function (response) {
console.log('STATUS: ' + response.statusCode);
console.log('HEADERS: ' + JSON.stringify(response.headers));
response.setEncoding('utf8');
response.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment