Handling PUT/DELETE arguments in PHP

前端 未结 6 1254
盖世英雄少女心
盖世英雄少女心 2020-11-30 21:30

I am working on my REST client library for CodeIgniter and I am struggling to work out how to send PUT and DELETE arguments in PHP.

In a few places I have seen peopl

6条回答
  •  渐次进展
    2020-11-30 22:08

    This is how i sole my DELETE problem:

    ==>> in REST_Controller.php i replace the delault _parse_delete() function by :

    protected function _parse_delete()
    {
        $this->_delete_args = $_DELETE;
        $this->request->format and $this->request->body = file_get_contents('php://input');
        // Set up out DELETE variables (which shouldn't really exist, but sssh!)
        parse_str(file_get_contents('php://input'), $this->_delete_args);
    }
    

    ;) it works for me!

提交回复
热议问题