Last active
May 14, 2017 01:58
-
-
Save Ema4rl/aebb63db1c76786c9cba811d69339fd3 to your computer and use it in GitHub Desktop.
Codeigniter Restserver DELETE method with request body [HACK]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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