forked from rodrigorm/rest
-
Notifications
You must be signed in to change notification settings - Fork 37
kvz edited this page Sep 14, 2010
·
3 revisions
The following is a preliminary attempt to address some frequently asked questions. Feel free to add others for us to answer.
Yes you can. In my CakePHP app I've implemented a public function store() {} in my controllers. I post data to it in the following format:
servers {
0: {
hostname: 'www01.example.com'
},
1: {
hostname: 'www02.example.com'
}
}
And do a saveAll with cake.
The XML variant would be:
<servers>
<item>
<hostname>
www01.example.com
</hostname>
</item>
<item>
<hostname>
www02.example.com
</hostname>
</item>
</servers>
If you need more client side examples, you could look at my company's client-side class over at true-api. It's smoothens working with this this plugin as it offers end-users an object oriented way of talking to it.
base64_encode is the way to fly. Encode it client side, then if your webserver + php allow big POSTs, you could base64_decode a field when it reaches your CakePHP app.