CircleOfNice / CiRestClientBundle

Mapper for PHP internal curl library
GNU General Public License v3.0
57 stars 20 forks source link

Payload validation #35

Open alex10fan opened 8 years ago

alex10fan commented 8 years ago

CURLOPT_POSTFIELDS by default accepts strings and flat (1-dimensional) arrays.

Update payload validation of Curl->sendRequest method to allow arrays or let user to set payload manually using curl options (do not set payload if it is empty).

Without that it's impossible to post files.

$payload['file'] = new \CURLFile($file, $mimeType); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

TobiasHauck commented 8 years ago

Hey, thanks for reporting and sorry for being so late :S

There's another issue about file upload #36, so I think these issues are related to each other. Would you mind to find a solution? Maybe you can have a short chat with the other dev having the same problem, so you won't do the same in parallel.