We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dio
5.4.1
iOS
Default Dio
flutter doctor -v
• Flutter version 3.19.2 on channel stable at /Users/zhoujing/fvm/versions/3.19.2 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 7482962148 (3 weeks ago), 2024-02-27 16:51:22 -0500 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/zhoujing/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/zhoujing/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) [✓] VS Code (version 1.87.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.84.0
3.3.0
Cancel a previously completed task, causing other ongoing tasks to fail
Future<void> test() async { final dio = Dio(); try { CancelToken testTask = CancelToken(); final response = await dio.get('https://jandan.net/api/post/dot', cancelToken: testTask); print('Success:$response'); Future<void>.delayed(const Duration(milliseconds: 30), () { print('------cancel------${DateTime.now()}'); testTask.cancel(); }); dio .get('https://jandan.net/api/post/dot') .then((value) => print(value)) .catchError((e) { print('------error-------${DateTime.now()}-$e'); }); } catch (e) { print(e); } }
working
flutter: Success:{"code":0,"msg":"success","data":{"logged_in":false,"admin_domain":"http://x.jandan.net"}} flutter: ------cancel------2024-03-16 23:04:03.181944 flutter: ------error-------2024-03-16 23:04:03.182706-DioException [unknown]: null Error: HttpException: Connection closed before response was received, uri = https://jandan.net/api/post/dot
The text was updated successfully, but these errors were encountered:
Duplicate of #2135
Sorry, something went wrong.
No branches or pull requests
Package
dio
Version
5.4.1
Operating-System
iOS
Adapter
Default Dio
Output of
flutter doctor -v
Dart Version
3.3.0
Steps to Reproduce
Cancel a previously completed task, causing other ongoing tasks to fail
Expected Result
working
Actual Result
flutter: Success:{"code":0,"msg":"success","data":{"logged_in":false,"admin_domain":"http://x.jandan.net"}}
flutter: ------cancel------2024-03-16 23:04:03.181944
flutter: ------error-------2024-03-16 23:04:03.182706-DioException [unknown]: null
Error: HttpException: Connection closed before response was received, uri = https://jandan.net/api/post/dot
The text was updated successfully, but these errors were encountered: