Skip to content

Instantly share code, notes, and snippets.

@achiko
Created March 10, 2017 11:42
Show Gist options
  • Save achiko/43c12a8c5a6b5fda59ab9f1a2d3fe9d3 to your computer and use it in GitHub Desktop.
Save achiko/43c12a8c5a6b5fda59ab9f1a2d3fe9d3 to your computer and use it in GitHub Desktop.
var http = require('http');
var req = http.get({
host: 'http://localhost',
path: '/?id=12'
}, function(response) {
var body = '';
response.on('data', function(d) {
body += d;
});
response.on('end', function() {
console.log(body);
});
});
req.on('error', function(e) {
console.log('ERROR: ' + e.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment