1

I can't figure out how to make a POST request that dosen't automatically follow redirects on Flutter Web. I've tried using Flutter's HTTP library, Dart's HTML library, and a third party plugin Dio, and set the followRedirects flag to false on all of them. All of them have automatically followed redirects anyway, and there are cookies that are only contained in one of the redirects that I am trying to obtain. Using a network inspector I am able to see that all of the redirects are followed and the cookie I am looking for is there, but I can't get the response in Flutter. I have also tried dio's cookiejar plugin, but it dosen't seem to cache any cookies for any uri on Web.

Any help would be appreciated, thanks for reading.

systemdev
  • 33
  • 5
  • What are you expecting by not following a redirect? Sounds like you're getting the proper response, and acting on it! – Randal Schwartz Jan 31 '22 at 18:21
  • I should have phrased that better - I'm ok with following redirects, I just want to be able to access the cookies in them. In my current problem the only "response" variable I can access is the one for the final webpage, which dosen't contain the cookie I need. – systemdev Jan 31 '22 at 18:40

0 Answers0