dio
dio copied to clipboard
Dio Throws Exception on DELETE Request with 204 Response
Package
dio
Version
5.5.0
Operating-System
Web
Adapter
Default Dio
Output of flutter doctor -v
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.22631.3880], locale en-US)
• Flutter version 3.19.6 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 54e66469a9 (4 months ago), 2024-04-17 13:08:03 -0700
• Engine revision c4cd48e186
• Dart version 3.3.4
• DevTools version 2.31.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at C:\Users\andrew\AppData\Local\Android\sdk
• Platform android-34, build-tools 32.1.0-rc1
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.6+0-b2043.56-10027231)
[√] VS Code (version 1.92.0)
• VS Code at C:\Users\andrew\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.94.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3880]
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127
• Edge (web) • edge • web-javascript • Microsoft Edge 127.0.2651.86
[√] Network resources
• All expected network resources are available.
Dart Version
3.3.4
Steps to Reproduce
Create a flutter application with dio as a dependency.
Send a DELETE request to an endpoint which returns a 204 "No Content" http status code.
Expected Result
The request goes through without throwing an exception.
Actual Result
The request throws a DioException with the message "SyntaxError: Unexpected end of JSON input".