This repository was archived by the owner on Sep 26, 2022. It is now read-only.
Add additional logic for FormData typed request bodies#126
Merged
thomasvidas merged 1 commit intocapacitor-community:1.1.0from Jun 25, 2021
herecoulbeyourname:feature/web-formData
Merged
Add additional logic for FormData typed request bodies#126thomasvidas merged 1 commit intocapacitor-community:1.1.0from herecoulbeyourname:feature/web-formData
thomasvidas merged 1 commit intocapacitor-community:1.1.0from
herecoulbeyourname:feature/web-formData
Conversation
-Since Object.keys() doesn't return anything for FormData typed objects, use a FormData specific function to iterate over the key/value pairs.
thomasvidas
approved these changes
Jun 25, 2021
Merged
thomasvidas
added a commit
that referenced
this pull request
Jul 15, 2021
* feat: Add support for CJS * feat(android): Set "GET" as default HTTP function in `downloadFile` function * feat(android): Updated downloadFile method on RequestHandler to use GET by default * feat: Adding support for posting json arrays. (#128) * Android - Prevent extra new line in text response. * Android - Support json array requests. * Android - Add error property on JSObject output. * ios - Support array request. * feat(web): Add additional logic for FormData typed request bodies (#126) * fix(android): fix bug on android when receiving plain boolean values (#145) * feat(iOS) Fix: Allow non-object request bodies (#141) * feat: implement getRequestDataAsMultipartFormData * fix: allow non-object http body * feat(iOS): Add fallback to always try to parse the request data no matter the content type * feat(iOS): implement getRequestDataAsMultipartFormData (#139) * fix(android): Allow non-object request bodies (#143) * feat: implement getRequestDataAsMultipartFormData * fix: allow non-object http body * feat(iOS): Add fallback to always try to parse the request data no matter the content type * feat(android): non-object post body * fix: bug where httpconn was being written to after it was closed * fix(android): add in missing get, post, put, patch, and del functions to public API * fix(ios): Publicly expose get, post, put, patch, del functions on Http plugin object * chore(example): Update example project lockfiles * fix(android): Fix issues with timeouts and remove unused imports * chore: Cleanup .gitignore * chore: Bump version to 1.1.0 Co-authored-by: ultimate-tester <ultimate-tester@users.noreply.github.com> Co-authored-by: Joel Nieto <joelnietotec@outlook.com> Co-authored-by: Adrian Sanchez <sgzadrian@gmail.com> Co-authored-by: milanc <8333458+milanc@users.noreply.github.com> Co-authored-by: herecoulbeyourname <57253976+herecoulbeyourname@users.noreply.github.com> Co-authored-by: Frank608 <56638143+Frank608@users.noreply.github.com> Co-authored-by: Emily Curry <emily@curry.sh>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current web implementation seems to not include anything in the request body if the data property is a FormData object. In my opinion, the problem lays in iterating over the FormData content using Object.keys(), which doesn't seem to return anything for a FormData object. My suggestion is to use a separate FormData specific method to iterate over the FormData content.
-Since Object.keys() doesn't return anything for FormData typed objects, use a FormData specific function to iterate over the key/value pairs.