REST API codeigniter POST method problem (json)

hi, i'am a beginner in developping a REST API with codeigniter. i want to make a POST/PUT request and i always have this problem.{ id:"12" name:"0"}
the URL :hotsname/code/index.php/API/user/name/jhon

the item is created in database but with a null (0) value.
i tried the var_dump and i have this response (unexpected token<)
this is my function

function user_post(){
        //create a user and respond with status/errors
        
     $data = array(
                
'name' => $this->input->post('name')
            );
            $id = $this->Usrs_model->save($data);
        $return = $this->Usrs_model->get_by_id($id)->row();
        //var_dump($return);
         if($return)
        {
            $this->response($return, 200);
        }
        else
        {
            $this->response(array('error' => 'Entity could not be created'), 404);
        }
    
    }

thank you for your help

Please sign in to leave a comment.