-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
Empty response body is read as null #1834
Comments
@AlexV525 I'm still receiving null with this pubspec and the original code snippet. I may have missed something, but could you double check? dependencies:
dio:
git:
url: https://github.com/cfug/dio.git
path: dio
ref: fix/null-response-body-only-when-response-type-json |
PR updated. |
made a comment on it, I think enabling users to easily keep back compatibility with Dio v4 decoding would significantly help reduce chances for apis to break post upgrade. Also this wasn't explicitly called out in the change logs for Dio v5, if possible it would be great to update documentation to include it as part of the breaking changes post v4 upgrade. |
…1874) Resolves #1834. ### New Pull Request Checklist - [x] I have read the [Documentation](https://pub.dev/documentation/dio/latest/) - [x] I have searched for a similar pull request in the [project](https://github.com/cfug/dio/pulls) and found none - [x] I have updated this branch with the latest `main` branch to avoid conflicts (via merge from master or rebase) - [x] I have added the required tests to prove the fix/feature I'm adding - [x] I have updated the documentation (if necessary) - [x] I have run the tests without failures - [x] I have updated the `CHANGELOG.md` in the corresponding package
Package
dio
Version
5.1.2
Output of
flutter doctor -v
Dart Version
No response
Steps to Reproduce
Run the following dart source.
Expected Result
Print empty string.
I found this from my app's breaking behavior so think v4 would return empty string in this situation.
Also I think regarding as empty string is correct because the response has text/html content type and 200 OK, not no content.
Actual Result
The text was updated successfully, but these errors were encountered: