flutter dio 处理200以为的错误状态码
通过dio.post时遇到了400错误,直接到异常处理区域了,可以通过catch进行拦截
try {
// 发送请求
Response response = await dio.post(ossUrl, data: data);
print(response.statusCode);
print(response.statusMessage);
return 'success';
} on DioError catch (e) {
print(e.response!.statusCode);
print(e.response!.statusMessage);
throw(e);
}