flutter 登录接口json解析报错
https://blog.csdn.net/yechaoa/article/details/93044925
void _requestLoginAction() async { Response response; final dio = Dio(); dio.options.baseUrl = 'https://ams.e-next.cn/api'; dio.options.connectTimeout = Duration(seconds: 5); dio.options.receiveTimeout = Duration(seconds: 3); dio.options.responseType = ResponseType.plain; response = await dio.post('/app/login', data: {'username': _email, 'password': _password}); debugPrint(response.data.toString()); var map = json.decode(response.data.toString()); var aModel = LoginModelEntity.fromJson(map); if (aModel.code == 200 ){ debugPrint(aModel.data?.token); } }
标签:dio,aModel,character,response,options,FormatException,data,Flutter From: https://www.cnblogs.com/huangzs/p/17575089.html