Skip to content

Instantly share code, notes, and snippets.

@Ema4rl
Last active May 14, 2017 01:58
Show Gist options
  • Save Ema4rl/aebb63db1c76786c9cba811d69339fd3 to your computer and use it in GitHub Desktop.
Save Ema4rl/aebb63db1c76786c9cba811d69339fd3 to your computer and use it in GitHub Desktop.
Codeigniter Restserver DELETE method with request body [HACK]
require APPPATH.'libraries/REST_Controller.php';
class API_Controller extends REST_Controller
{
/**
* Parse the DELETE request arguments [HACK]
*
* @access protected
* @return void
*/
protected function _parse_delete()
{
// It might be a HTTP body
if ($this->request->format)
{
$this->request->body = $this->input->raw_input_stream;
}
else if ($this->input->method() === 'delete')
{
$this->_delete_args = $this->input->input_stream();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment