When I try to post a request I get
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: ok(handshake.cc:354))
my code (provided in the example)
Future login() async {
final request = {
"j_username": "user1",
"j_password": "pass1",
};
final response = await _dio.post('/itim/restlogin/login.jsp', data: request);
//get cooking from response
final cookies = response.headers.map['set-cookie'];
if (cookies.isNotEmpty && cookies.length == 2) {
final authToken = cookies[1].split(';')[0]; //it depends on how your server sending cookie
//save this authToken in local storage, and pass in further api calls.
aToken = authToken;
print("authToken");
//saving this to global variable to refresh current api calls to add cookie.
print(authToken);
}
print(cookies);
//print(response.headers.toString());
}