error log1:
[🔔 Dio] LoginReq cannot be used to imply a default content-type, please set a proper content-type in the request.
error log2:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [bad response]: This exception was thrown because the response has a status code of 400 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 400 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.
#0 DioMixin.fetch (package:dio/src/dio_mixin.dart:520:7)
#1 _ApiService.login (package:flutter_retrofit/retrofit/api_service.g.dart:53:21)
#2 RetrofitUtils.login (package:flutter_retrofit/retrofit/retrofit_utils.dart:71:20)
#3 _MyHomePageState.build.. (package:flutter_retrofit/main.dart:82:100)
if use Map<String,dynamic> replace bean to @Body parameter, It's OK
error log1:
[🔔 Dio] LoginReq cannot be used to imply a default content-type, please set a proper content-type in the request.
error log2:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [bad response]: This exception was thrown because the response has a status code of 400 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 400 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.
#0 DioMixin.fetch (package:dio/src/dio_mixin.dart:520:7)
#1 _ApiService.login (package:flutter_retrofit/retrofit/api_service.g.dart:53:21)
#2 RetrofitUtils.login (package:flutter_retrofit/retrofit/retrofit_utils.dart:71:20)
#3 _MyHomePageState.build.. (package:flutter_retrofit/main.dart:82:100)
if use Map<String,dynamic> replace bean to @Body parameter, It's OK