Created
March 10, 2017 11:42
-
-
Save achiko/43c12a8c5a6b5fda59ab9f1a2d3fe9d3 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 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