const http = require("http");
let saymonHostname = <...>
let path = "/node/api/links/" + linkId + "/stat-rules";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
"hostname": saymonHostname,
"Content-Type": "application/json"
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) {
let data = JSON.stringify([
"conditions": [{ "x": 1 }],
"rules": [{ "type": "extend" }],