POST
関数内のページ コントローラーに送信されたデータを取得したいのですinit()
が、取得したのは空の配列です。
ただし、getRawBody
表示データを取得します。
これが私が使用するコマンドです:
curl http://localhost/api/page/7 -X PUT -d "test=true"
出力は次のとおりです。
配列 ( ) 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());
}
}