Hello. When trying to launch Corona News app as Flutter web, I get this error:
Access to fetch at 'http://covid19-az.herokuapp.com/api/stats' from origin 'http://hhhhtyu.000webhostapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
This Problem with js
I got the same error before
Important use header allow access origin then use proxy web use https before calls api
Https://any_proxy//your_api
Or try use
Dio package
Hello. When trying to launch Corona News app as Flutter web, I get this error:
Access to fetch at 'http://covid19-az.herokuapp.com/api/stats' from origin 'http://hhhhtyu.000webhostapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.