let http = require("http");
let req = http.request({
hostname: "ya.ru",
port: 80,
method: "GET"
}, res => {
console.log("STATUS: " + res.statusCode);
res.on("data", chunk => {
console.log("BODY: " + chunk);
});
});
req.on("error", err => {
console.log("Problem with request: " + err.message);
});
req.end();