I want to make a status query of my web server for my website which I program with Flutter, which is green when the server is reachable and red when not. With my current code I always get a "XMLHttpRequest" error.
I have already tried it by simple pinging but have also come to no solution.
try these headers
get headers => {
'Accept': '*/*',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
};