-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Use the proper transformers for specific dataType
and responseType
values.
#811
Comments
I think there are two sides to this, right?
The landscape for fixing the
axios/test/unit/adapters/http.js Line 53 in ec97c68
axios/test/specs/requests.spec.js Line 161 in ec97c68
Both of these stem from the fact that response parsing has defaulted to always trying to parse JSON , regardless of |
Then, if we want to keep the default parsing behavior a possible solution could be to add an option to disable automatic parsing? |
Here are my conclusions,
|
Lines 57 to 65 in 6642ca9
I really don't think that the current default parsing behavior is sensible. It may even cause the data to be altered under certain circumstances, e. g.: This is not a far-fetched example, but rather a problem that has really occurred and has required quite a bit of debugging. Especially since this is not adequately documented in my opinion. I suggest that parsing to JSON is only done if the data is really in JSON format, i. e. the |
add fix for axios/axios#811
Jut hit this bug as well but I did find a workaround which seems to work for me so might save someone else some time:
|
I also got this bug and if you are using the alias methods, you can always override the default transformer:
|
FYI I've just replaced Axois with Got because of this. |
Default parsing has been changed, please open a new issue should this still be a issue. |
Ran into this on 0.24.0. Thanks @lucrus73 , Got works great! |
I had a problem with using axios to file download, where I want to setup So I have to convert the arraybuffer response to json by this:
For people facing the same issue... |
- Migrate from Vue 2 to Vue 3 - Refactor History View - Refactor Workspace View - Refactor Files and Editor components - Refactor CSS - Replace Bootstap Modals with Vue-universal-modal - Replace Font Awesome with Material Icons ### Fix - Raise the correct exception at file loading and show the error in the editor - Fix exception related to axios/axios#811
Implement and document proper transformation of request and response body according to
dataType
andresponseType
options.This will fix: #375, #448, #765, #793
The text was updated successfully, but these errors were encountered: