Welcome Guest, Not a member yet? Register   Sign In
Phil Sturgeon's REST Client: help posting to REST server
#2

[eluser]cgeisel[/eluser]
Victory! It's what I suspect is a bug in the example_api.php REST_Controller. This method:
Code:
$this->post()

... doesn't seem to be an alias for $this->input->post() after all. When I changed my example_api.php code to:

Code:
function user_post()
{  
    //$this->some_model->updateUser( $this->get('id') );
    $message = array('id' => $this->get('id'), 'name' => $this->input->post('name'), 'email' => $this->input->post('email'), 'message' => 'ADDED!');
        
    $this->response($message, 200); // 200 being the HTTP response code    
}

It started receiving the POSTed parameters correctly. Whew! I post my solution here in case anyone else runs into a similar problem.

I've also opened an issue in the REST Client github site. I'll post back here if the author has any feedback.


Messages In This Thread
Phil Sturgeon's REST Client: help posting to REST server - by El Forum - 06-03-2010, 11:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB