requests
requests copied to clipboard
I get the "Refused to set unsafe header "cookie"" error when I try from flutter web
Hi!
When I am using Flutter built on chrome and try to send a post request to my Express server to sign in, the cookie is not stored and the console reads the error : Refused to set unsafe header "cookie".
Here is the code that calls from the server side:
final response = await Requests.post("http://localhost:3000/signin", json: {"username": username, "password": password}, withCredentials: true);
response.raiseForStatus();
- OS: Windows 10 Home
- Chrome Version 106.0.5249.119
Hi @mikeybellissimo, on web when an http request is done, it's the browser that handles the cookie. The error you get from the console shouldn't be an issue, it's just dart trying to set the cookie by itself though it's actually the browser that does that.
Is response.raiseForStatus();
stopping the app ?
i have same isue. @mikeybellissimo