This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
feat(web/ios): allow string value in body #196
Merged
thomasvidas
merged 26 commits into
capacitor-community:master
from
emily-curry:fix/ios-string-body
Nov 9, 2021
Merged
feat(web/ios): allow string value in body #196
thomasvidas
merged 26 commits into
capacitor-community:master
from
emily-curry:fix/ios-string-body
Nov 9, 2021
Conversation
This file contains 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
…HTTP method (each HTTP method may have a body or not).
Add note that we use ergon-master branch
Adjust data handling in the ios HttpRequestHandler to check the data, if available, for correctness and fail otherwise.
Remove duplicat code, sorry for that.
…HTTP method (each HTTP method may have a body or not).
Adjust data handling in the ios HttpRequestHandler to check the data, if available, for correctness and fail otherwise.
Remove duplicat code, sorry for that.
* chore(iOS): remove local pods from project * refactor: add postbuild script to install up to date pods * refactor: change postbuild to prepublishOnly * release: release 1.1.2
…os (capacitor-community#157) * Update HttpOptions * Add support for disabling automatic HTTP redirects on android * Add support for disabling automatic HTTP redirects on ios
…rgon/http into ios-fix-required-body-handling
This reverts commit aa6d19e.
This was referenced Nov 9, 2021
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.
This change allows one to use a string value as the body of the request, and have that value be written directly to the request object without any marshalling/unmarshalling to/from JSValue objects.
The use case for this is more of a workaround than a feature. I have observed (though I'm finding it quite difficult to pin down all of the exact conditions), that sometimes with large deeply-nested objects, that the conversion from POJO -> capacitor bridge -> JSValue -> JSObject is not always consistent between platforms, and sometimes omits data. For example, on Android, if I have a POJO with a key that is the literal value
null
, when a JSObject is constructed from that object, that key+value pair is omitted. In my opinion, it is very important that for this plugin in particular we are able to guarantee that the requests are sent exactly as written. Sending strings over the bridge allows us to have that guarantee, at least for non-binary utf8 content. If ionic-team/capacitor#984 is implemented, blobs and maybe typedarrays could be future enhancements that give that guarantee for all data.No changes were made to the Android implementation because this is already the current behavior, it just writes strings as-is.
This is based on #149, because it touches some of the same code and would cause conflicts.