codeigniter-curl icon indicating copy to clipboard operation
codeigniter-curl copied to clipboard

PUT request parameters needed to be URL-encoded

Open bsparacino opened this issue 12 years ago • 0 comments

I am using your REST Client/Server libraries along with your curl library. I noticed that when sending a PUT request from client to server, the server would receive the data but it wouldn't be in a proper format such as below.

------------------------------22061304c7a1
Content-Disposition: form-data; name="id"
15

After messing around I determined it to be the curl library. I then found this article: http://www.lornajane.net/posts/2009/putting-data-fields-with-php-curl

It states that for PUT via curl you should use: curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));

After adding http_build_query I am now able to receive data in a proper array format on the REST server

bsparacino avatar Mar 06 '13 16:03 bsparacino