-
-
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
api request fail - please set a proper content-type in the request #2338
Comments
The log has told you that |
1.) User is @JsonSerializable and has toJson method !! everything works with 5.6.0 and below. There must be some breaking change, that is not documented, i read the migration guide, no change after 5.0.0 mentioned there |
Could you split a minimal reproducible example? |
i add removeImplyContentTypeInterceptor and everything works like before (because i add my own content type header to post requests). |
The imply interceptor only logs when no content-type and will not manipulate any of your payload. |
exactly in my case the problem is that ImplyContentTypeInterceptor runs before content type is set in my own interceptor. b.) for some other cases switch inside data break the type |
You should always define your type in your interceptors, which is why the imply one runs first. |
Package
dio
Version
5.7.0
Operating-System
Android
Adapter
Default Dio
Output of
flutter doctor -v
Dart Version
3.5.4
Steps to Reproduce
we are doing qutite simple api requests e.g.
or
Expected Result
everything worked fine with dio 5.6.0 or lower.
Expected the same with 5.7.0
Actual Result
requests fail with:
btw content type is set in interceptor:
The text was updated successfully, but these errors were encountered: