Skip to content

Instantly share code, notes, and snippets.

@harbhub
Created October 3, 2013 16:21
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 harbhub/afbe4655ddd249b9b0e6 to your computer and use it in GitHub Desktop.
Save harbhub/afbe4655ddd249b9b0e6 to your computer and use it in GitHub Desktop.
var https = require('https');
var options = {
hostname: 'harbachi.nodejitsu.com',
port: 80,
//path: '/public/www/app/autoparts/homePage.html',
path: '/',
method: 'GET'
};
var req = https.request(options, function (res) {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment