vinn vinn - 6 months ago 42
PHP Question

codeigniter restful api yielding null value with status code 400 in PUT operations

I cant be able to carry PUT operations on my codeigniter restful api app due to status code 400.

Here is the controller:

public function index_put(){
// for put you need to pass id as parameter

// Use validation library, instead of checking just for value.

if($this->form_validation->run() == FALSE)
// send back list of validation errors.

$this->response(array('response' => 'content updated
$this->response(array('error'=> 'sorry, technical error occurred, please
try again later...'), REST_Controller::HTTP_BAD_REQUEST);

Answer Source

I realized that PUT method is not working with me. Using POST method instead saved my day.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download