const http = require("http");
let saymonHostname = <...>
let path = "/node/api/notification-templates/" + templateId + "/preview/" + type;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
"hostname": saymonHostname,
let req = http.request(options, function (res) {
res.on("data", function (chunk) {
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
res.on("error", function (error) {