You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capacitor HTTP POST with ContentType application/x-www-form-urlencoded body not encoded on iOS (please note that it is properly encoded on Android so the behavior differs between these platform) - see below
Here is the request on iOS (note that the special characters are not encoded)
Here is the same request on Android (note that the special characters are properly encoded)
This causes the problem when the server does not recognize the content of the request as expected when sent from iOS platform (all works fine on Android)
If shouldEncodeUrlParams HttpOption support is added on iOS (see https://capacitorjs.com/docs/apis/http#httpoptions) this should allow to encode by default and still allow to avoid encoding as it is now (however, this still seems to be breaking change)
The text was updated successfully, but these errors were encountered:
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Other API Details
Platforms Affected
Current Behavior
Capacitor HTTP POST with ContentType application/x-www-form-urlencoded body not encoded on iOS (please note that it is properly encoded on Android so the behavior differs between these platform) - see below
Here is the request on iOS (note that the special characters are not encoded)
Here is the same request on Android (note that the special characters are properly encoded)
This causes the problem when the server does not recognize the content of the request as expected when sent from iOS platform (all works fine on Android)
It also seems that
shouldEncodeUrlParams
HttpOption is not supported on iOS (see https://capacitorjs.com/docs/apis/http#httpoptions)Expected Behavior
Request content/body encoding must be the same for the both iOS and Android platforms.
Project Reproduction
https://github.com/ryaa/capacitor-http-post-application-x-www-form-urlencoded-body-not-encoded-on-ios
Additional Information
See README in the Project Reproduction repository for more details.
The potential fix encode before sending the request - see https://github.com/ryaa/capacitor-http-post-application-x-www-form-urlencoded-body-not-encoded-on-ios/blob/master/src/app/home/home.page.ts#L26 or fix Capacitor HTTP plugin - see #7841
Please note that for the latter fix only % is encoded on iOS (see below) but this fixes the problem on our end and the server correctly recognize the values
If
shouldEncodeUrlParams
HttpOption support is added on iOS (see https://capacitorjs.com/docs/apis/http#httpoptions) this should allow to encode by default and still allow to avoid encoding as it is now (however, this still seems to be breaking change)The text was updated successfully, but these errors were encountered: