Skip to content
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

Body Handling Override #87

Open
WatchfulEyeOfZod opened this issue Dec 19, 2024 · 0 comments
Open

Body Handling Override #87

WatchfulEyeOfZod opened this issue Dec 19, 2024 · 0 comments

Comments

@WatchfulEyeOfZod
Copy link

In cases where the RequestBody is FormData, the adjustments to the body made by the transformRequestParams are not being honored correctly. Instead of using the default input.body, I believe the method should be using the body as returned from the transformRequestParams (e.g reqParams.body

diff --git a/src/utils/ajax.js b/src/utils/ajax.js
index a315cde..4650fab 100644
--- a/src/utils/ajax.js
+++ b/src/utils/ajax.js
@@ -225,7 +225,9 @@ export class Requester {
                 init.headers['Content-Type'] = 'application/json';
             } else {
                 // FormData
-                newBody = input.body;
+                // newBody = input.body;
+                // Allow the transformRequestParams to Overide Body
+                newBody = reqParams.body
             }
             init.body = newBody;
         }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant