-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Bug]: CapacitorHttp breaks axios requests with multipart/form-data
#7579
Comments
Repo with reproduction: |
This issue has been labeled as |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I have a very similar issue when doing a It was working fine (200 results), until I upgraded to Capacitor 6 (tried different versions, all 500 results only), without making any other code changes. The only change I can see in the request logged by Capacitor 5 -
Capacitor 6 -
Here is part of my post function, very simple, no headers specified:
When I include headers in my request with |
Is it possible that Capacitor 6 removes the core-plugin.ts -> buildRequestInit line 424
Besides the CapacitorUrlRequest.m line 191
|
If I remove the check about contentType != nil it works (no special boundary needed in my case, just for test) |
Further investigations: Can somebody explain why the browser is expected to set the Content-Type and why this does not happen? |
axios version 1.x |
Capacitor Version
Other API Details
No response
Platforms Affected
Current Behavior
axios
request withContent-Type: "multipart/form-data"
is not working. It doesn't send neitherContent-Length
,Content-Type
no content itself.It happens when
CapacitorHttp
plugin is enabled.I have a simple form allowing uploading files.
and handler
capacitor.config.ts
Expected Behavior
axios should work no matter if
CapacitorHttp
enabled or notProject Reproduction
Additional Information
No response
The text was updated successfully, but these errors were encountered: