-
-
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
ToFormData - Which way should we proceed? #4471
Comments
Can you please add this to the discussion :) |
See #4474 |
You miss the point. The transformation to the FormData instance is applied only if the payload is a plain object and content-type is So the question is:Do Axios users pass a plain object as a payload with Most Likely Answer:No. Passing JSON with Therefore, I believe this change will not break existing user projects in any way. And yes, the serialization quality of that helper is not good enough. I'm working on better implementation. |
@DigitalBrainJS I did not miss that point (see quote at the beginning of your comment 🙂). I thought we need to have a test if a user passes FormData current change doesn't affect it in any way. But I noticed a test you added in #4448 that solves this issue. I guess my only reservation currently is that at first we should not recommend it as the preferred method of choice in the documentation. Be more gradual. First see how it is accepted (No major issues/bugs) and only then recommend it as the first/default method. |
Sorry @jasonsaayman . @DigitalBrainJS replied so perhaps we can keep this discussion here and have the next one in the discussion tab. |
Discussion moved to #4474 (comment). |
#3757 added a function converts a JS object to a FormData format.
My suggestion was, to export it independently for now, and proceed in a risk free approach.
@DigitalBrainJS thought we should add it by default if data is not in FormData format, and content-type is
multipart/form-data
. @DigitalBrainJS merged #4413 accordingly.Recent
FormData
issues (such as #4406) show that tests related toFormData
are lacking. . If we do decide to publish #4413 we need to make sure that there are proper tests for usingtoFormData
by default. More specifically, that current usage, passing data inFormData
format, is not affected at all by the change.@jasonsaayman
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: