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

Update cURL.php #169

Closed
wants to merge 1 commit into from
Closed

Update cURL.php #169

wants to merge 1 commit into from

Conversation

andreipetcu
Copy link

Allow multipart/form-data on POST

Allow multipart/form-data on POST
@rmccue
Copy link
Collaborator

rmccue commented Oct 2, 2015

I'm not sure what your intention is here, but this will break existing functionality.

@andreipetcu
Copy link
Author

It will allow the use of CurlFile library or to send files via $data['file'] = '@/path/to/file' with multipart/form-data header instead of application/x-www-form-urlencoded.
Basically the library won't permit file upload because of that code line:
$data = http_build_query($data, null, '&');

It should let cURL handle how to send the data instead of forcing it to send with application/x-www-form-urlencoded header.

I've used the library with that line commented out and works. Why do you say it will break existing functionality?

@rmccue
Copy link
Collaborator

rmccue commented Oct 2, 2015

CurlFile or @/file support needs to be supported across both cURL and sockets consistently. Changing this will on the surface allow you to send files, but won't work for sockets, so this will break on any servers without cURL.

In addition, passing an array or object directly to cURL rather than handling it ourselves doesn't have the same behaviour; IIRC, there are subtle problems with different versions of cURL here.

See #34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants