http
http copied to clipboard
Requests in fluttter web
Hi,
I have a question.
I'm trying to make a http request using this package but i get thie error:
How can I resolve this issue?
In local, with emulator device is ok but on web I have this problem.
P.S. I setted also the header "Access-Control-Allow-Origin": "*" Thanks a lot.
I have this error too.
update: I add headers and solved.
res.headers.add('Access-Control-Allow-Origin', '*'); res.headers.add('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT, DELETE, HEAD');
same here cant access my back end using flutter web 2.8.1 , the back end is node js and i applied much methods like cors and xhr2 .. and ading Access-Control-Allow-Origin , Access-Control-Allow-Methods and Access-Control-Allow-Headers but still facing the same problem which
XMLHttpRequest error
i make it works on local host by adding --disable-web-security to chrome file in the sdk but i used ngrok server and now facing the same error
This problem only occurs when building a web app and hosting from a web server (not localhost). Can the http package somehow wrap this request in a "form" when building the web app so that it avoids the CORS error?
Reference: blocked by CORS policy
This problem only occurs when building a web app and hosting from a web server (not localhost). Can the http package somehow wrap this request in a "form" when building the web app so that it avoids the CORS error?
Reference: blocked by CORS policy
In my case, I had to create a service to do the request from. It wouldn't work directly from a web page.
I have the same Problem and can't solve it at the moment. The library example does not work either. (for web)