Closed lyf571321556 closed 1 year ago
it works well when Downgrading to version 4.0.6.
I can see the first request timed out but the next requests are successful. This might result in the host taking a while to seek through the DNS server. You can try to extend the connect timeout to 15~30 seconds which is a common value in production apps.
Closing as not reproducible. If you have other regular ways to always reproduce the issue, please provider them.
I can see the first request timed out but the next requests are successful. This might result in the host taking a while to seek through the DNS server. You can try to extend the connect timeout to 15~30 seconds which is a common value in production apps.
Closing as not reproducible. If you have other regular ways to always reproduce the issue, please provider them.
@AlexV525 ,I found that when the parameter 'data' passed to ‘dio.get()’ is not of type ‘String’, this issue can be reproduced.
try { final dio = Dio(); dio.options ..baseUrl = 'https://ones-liuyanfeng.myones.net/api/project/' ..connectTimeout = const Duration(seconds: 15) ..receiveTimeout = const Duration(seconds: 30); final result = await dio.get("auth/login_support", data: {}, options: Options( method: 'GET', )); print(result.toString()); } catch (e) { print(e); }
Package
dio
Version
5.3.2
Output of
flutter doctor -v
Dart Version
2.17.5
Steps to Reproduce
Expected Result
Actual Result
DioException [receive timeout]: The request took longer than 0:00:10.000000 to receive data. It was aborted.