I'm having this annoying problem while trying to make a web app for an SMS Eagle. I am trying to send an API request to the SMS Eagle server, to then send the SMS, which is succesful, but the only problem is that I can't seem to be able to get the response body.
In Javascript when I look at the response body property, the value is 'null'. But when I look in the network tab, I see the value. Notice how there is also 'status: 0' and other values that seem weird.
I have tried getting the value with response.json(), response.text(), response.blob() etc.. What am I doing wrong here? I have already tried multiple content-type headers too. This is my code:
fetch(`http://x.x.x.x/http_api/send_sms?login=${login_g}&pass=${pass_g}&message=${encodeURIComponent(message)}&to=${number}`, { method: 'GET', mode: 'no-cors', headers: { 'Content-Type': 'text/plain'}})
.then(response => response.text())
.then(data => console.log(data));
These are the response headers from the server:
Kind regards, Jasper