[英]Flutter DioError [DioErrorType.RESPONSE]: Http status error [403]
I get this massage:我得到这个按摩:
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: DioError [DioErrorType.response]: Http status error [403]
[错误:flutter/lib/ui/ui_dart_state.cc(198)] 未处理的异常:DioError [DioErrorType.response]:Http 状态错误 [403]
Here is loginCall method:这是 loginCall 方法:
Future<LoginModel?> loginCall(
String email,
String password,
) async {
Map<String, dynamic> json = {"email": email, "hashPass": password};
var response = await dio.post(baseUrl + "login", data: json);
print(response.data);
print(response.statusCode);
if (response.statusCode == 200) {
var result = LoginModel.fromJson(response.data);
print("gelen response: ${response.data}");
return result;
} else {
throw Exception("Error! ${response.statusCode}");
}
}
error 403 usually means unauthorized.错误 403 通常表示未经授权。 Therefore, you are probably entering incorrect email and password combination.
因此,您可能输入了错误的电子邮件和密码组合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.