I would like to get POST
data sent to page controller in init()
function but what I get is an empty array.
However, getting getRawBody
displays data.
Here is the command I use:
curl http://localhost/api/page/7 -X PUT -d "test=true"
and the output is:
Array ( ) test=true
class Api_PageController extends Zend_Rest_Controller
{
public function init()
{
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
print_r($this->getRequest()->getPost());
print_r($this->getRequest()->getRawBody());
}
}