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

Add support for sending POST with multipart/form-data #371

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

datagutten
Copy link
Contributor

Some sites require POST requests to be sent as multipart/form-data.
When passing an array as POST-data cURL defaults to multipart/form-data, but Requests will flatten and urlencode it. To avoid this I check if a Content-Type header containing multipart/form-data is set in the arguments to Requests::post.
I have implemented this for both cURL and fsockopen.

@codecov-io
Copy link

codecov-io commented Oct 5, 2019

Codecov Report

Merging #371 into master will decrease coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #371      +/-   ##
============================================
- Coverage     92.11%   91.98%   -0.13%     
- Complexity      760      766       +6     
============================================
  Files            21       21              
  Lines          1762     1772      +10     
============================================
+ Hits           1623     1630       +7     
- Misses          139      142       +3
Impacted Files Coverage Δ Complexity Δ
library/Requests/Transport/cURL.php 93.77% <100%> (+0.09%) 69 <0> (+3) ⬆️
library/Requests/Transport/fsockopen.php 94.41% <100%> (+0.22%) 71 <0> (+3) ⬆️
library/Requests.php 74.57% <0%> (-1.02%) 118% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a009398...99e8e86. Read the comment docs.

@jrfnl jrfnl changed the base branch from stable to develop June 18, 2021 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants