Hello friends, please can anybody help me? I am getting error in the second line, on new Headers()
Can anyone tell me how to achieve this? Or is there a workaround?
Thanks in advance.
import { fetch } from 'wix-fetch';
const headers = new Headers();
headers.append("Authorization", "Basic Z3JhbmRzdHVkeTpHcm5U3Q4OA==");
headers.append("Content-Type", "application/json");
const raw = JSON.stringify({
"messages": [{
"recipient": "37498664040",
"priority": "2",
"sms": {
"originator": "GrandStudy",
"content": {
"text": "Test"
}
},
"message-id": "201902280917"
}]
});
const requestOptions = {
method: 'POST',
headers: headers,
body: raw,
};
$w.onReady(function () {
fetch("https://sendsms.nikita.am/broker-api/send", requestOptions)
.catch(err => console.log(err));
})