function createMessage(opts) {
fetch(
"https://thermalprinter.accrocch.io/v1/print/printer/ESCPOS_Printer_Giacomo",
{
method: "POST",
mode: "no-cors",
headers: new Headers({
Accept: "application/json",
"Content-Type": "application/json"
}),
body: JSON.stringify(opts)
}
)
.then(function (response) {
return response.status;
})
.then(function (data) {
console.log("Got response:", data);
});
}