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

PUT request parameters needed to be URL-encoded #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bsparacino
Copy link

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

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

1 participant