I try the rest api. When I use GET
method, the code run. But when I use POST
method the code return false
.
Here is my restclient controller:
$this->load->spark('restclient/2.1.0');
$this->load->library('rest');
$this->rest->initialize(array('server' => 'serverhere'));
$name=$this->input->post('name');
$params = array('name' => $name);
$uri = 'userscontroller/user';
$result = $this->rest->post($uri, $params,"json");
$this->rest->debug();
Here is my restserver controller:
public function name_get(){
$name=$this->get("name");
$this->response($name);
}
public function name_post(){
$name=array('name'=>$this->input->post("name"));
$this->response($name);
}
The name_post
response is always FALSE
. Help!