-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
The responseHandler should respect Content-Type headers #2354
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
Comments
Oh hey this has been long merged and will be in 1.9. |
@markerikson I changed the title, as there is now an option to respect Content-Type headers, but it is not the default. |
Thanks for solving this problem.
|
Is handling the content type using the "responseHandler" still supported for each request? I have a use case where I need to do this but it seems all response hadling happens at the base query now. |
Howdy!
I believe the default responseHandler should be a little more intelligent to handle the response based on the content type header.
For example, in the default Go http package, you can see it is typical to return a response body of "404 page not found", "Unauthorized," etc. with non-200 responses.
It seems very counterintuitive that one must define a custom
responseHandler
for each and every endpoint to avoid RTK Query failing withPARSING_ERROR
in some rather common use-cases.The text was updated successfully, but these errors were encountered: