I\'m trying to send a post request in Flutter with DIO package.
Here is the request:
getSessionId() async {
var csrf =
I solved this way:
Add followRedirects: false and validateStatus: (status) { return status < 500;} to the request. Like this:
var response = await Dio().post("http://myurl",
data: requestBody,
options: Options(
followRedirects: false,
validateStatus: (status) { return status < 500; }
),
);
This way you can get from the 302 every headers and other.