I'm having trouble using the PUT data sent from AngularJS and found that the best way is to use the custom Zend plugin
class Web_Mvc_Plugin_JsonPutHandler extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { if (!$request instanceof Zend_Controller_Request_Http) { return; } if ($this->_request->isPut()) { $putParams = json_decode($this->_request->getRawBody()); $request->setParam('data', $putParams); } } }
You can then access through getParams as a PHP object.
$data = $this->getRequest()->getParam('data'); $id = $data->id;
source share