Phil Sturgeon's REST Client: help posting to REST server |
[eluser]cgeisel[/eluser]
Hi all, I'm new to CI and using Phil Sturgeon's REST Client & Server libraries, but I'm having a really hard time getting the client to POST correctly. I'm using his REST Server code exactly as written. The service is located here: http://test.christophergeisel.com/restserver/ Here's my REST Client: Code: class Newtest extends Controller When I set the method to 'get', the uri is set to 'index.php/example_api/user/id/1'. That works fine! If I set the method to 'post', the uri is set to 'index.php/example_api/user', and I send an array as the parameters, in this case: array('name' => 'Phil'); That gets me a response, but the 'name' parameter isn't set. Here's the code from the REST Server library, in example_api.php: Code: function user_post() Can anyone give me a hand here? I don't understand why my parameter isn't being received by the server, and I'm stumped. Shouldn't $this->post('name') get the value of 'name' from my parameter array? I'm confused. I also took a look at the file test.php that Phil includes with his REST Client code. He unserializes the parameters before sending them, but otherwise I think his technique is the same. Any help is much appreciated. I've been staring at this code for so long, I'm probably missing something obvious. |
Messages In This Thread |
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-03-2010, 06:07 PM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-03-2010, 11:02 PM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-25-2010, 04:17 AM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-25-2010, 09:08 AM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-25-2010, 01:08 PM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-25-2010, 01:24 PM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-25-2010, 02:11 PM
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 08-04-2011, 02:37 PM
|