简体   繁体   English

Flutter DioError [DioErrorType.RESPONSE]: Http 状态错误 [403]

[英]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.

相关问题 Flutter:DioError [DioErrorType.RESPONSE]:Http 状态错误 [500] - Flutter: DioError [DioErrorType.RESPONSE]: Http status error [500] Flutter Dio:DioError [DioErrorType.RESPONSE]:Http 状态错误 [429] - Flutter Dio : DioError [DioErrorType.RESPONSE]: Http status error [429] 无法捕获 dioerror [dioerrortype.response]:http 状态错误 [statusCode] - Unable to catch dioerror [dioerrortype.response]: http status error [statusCode] DioError [DioErrorType.RESPONSE]: Http 状态错误 [405] [已解决] - DioError [DioErrorType.RESPONSE]: Http status error [405] [Solved] DioError [DioErrorType.response]:Http 状态错误 [401] - DioError [DioErrorType.response]: Http status error [401] DioError [DioErrorType.RESPONSE]:Http 状态错误 [404] - DioError [DioErrorType.RESPONSE]: Http status error [404] DioError [DioErrorType.RESPONSE]: Http 状态错误 [400] 异常 - DioError [DioErrorType.RESPONSE]: Http status error [400] Exception DioError [DioErrorType.RESPONSE]:Http 状态错误 [500],为什么? - DioError [DioErrorType.RESPONSE]: Http status error [500], why? I/flutter (28276):此处发现错误 DioError [DioErrorType.response]:Http 状态错误 [404] - I/flutter (28276): Error found Here DioError [DioErrorType.response]: Http status error [404] I/flutter (23942): DioError [DioErrorType.RESPONSE]: Http 状态错误 [500] - I/flutter (23942): DioError [DioErrorType.RESPONSE]: Http status error [500]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM