Mert
Mert

Reputation: 288

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]

Here is loginCall method:

 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}");
    }
  }

Upvotes: 2

Views: 2910

Answers (1)

Kimiya Zargari
Kimiya Zargari

Reputation: 367

error 403 usually means unauthorized. Therefore, you are probably entering incorrect email and password combination.

Upvotes: 1

Related Questions