Node.js Error: connect ECONNREFUSED when using http.request
You haven't provided a url in http.request
.
Try var req = http.request("someurlhere", function(res) {
... etc.
Moreover, if you're using http.request like that, I can't quite see the purpose of the following block of code at all (maybe remnants from the rest of the completed script?)
http.get("http://api.hostip.info/get_json.php", function(res) {
console.log("Received response: " + res.statusCode);
});