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

Pest does not handle files in CURLOPT_POSTFIELDS #17

Open
eLod opened this issue Apr 27, 2012 · 1 comment
Open

Pest does not handle files in CURLOPT_POSTFIELDS #17

eLod opened this issue Apr 27, 2012 · 1 comment

Comments

@eLod
Copy link

eLod commented Apr 27, 2012

The php doc says (about CURLOPT_POSTFIELDS): 'As of PHP 5.2.0, value must be an array if files are passed to this option with the @ prefix.', but Pest does not respect this. It simply runs $data = (is_array($data)) ? http_build_query($data) : $data; (both in post and put) which obviously makes it impossible to upload files with the request (this way curl sends simply the '@/path' string with the given key, application/x-www-form-urlencoded). The fix should be straightforward: either detect using the '@/path' form and leave the $data as array, or create another method especially for this scenario (i think the former is the better approach).

@zuk
Copy link
Member

zuk commented Sep 14, 2012

I'll have to look into how this would affect older (pre 5.2.0) versions.

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

No branches or pull requests

2 participants