Y
Size: a a a
MZ
Y
CI
Y
Y
CI
CI
AG
b
AG
Exception has occurred.
SocketException (SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 38024)
AG
Ю
Exception has occurred.
SocketException (SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 38024)
AG
AG
C
AG
Future<RegisterResponse> login(String username, String password) async {
String basicAuth =
'Basic ' + base64Encode(utf8.encode('$username:$password'));
final http.Response response =
await http.post(baseURL + '/users/login', headers: <String, String>{
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': basicAuth,
});
if (response.statusCode == 200) {
return User.fromJson(json.decode(response.body));
} else {
return ErrorRegisterResponse.fromJson(json.decode(response.body));
}
}