1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect3 id="zend.controller.plugins.standard.puthandler">
4 <title>Zend_Controller_Plugin_PutHandler</title>
7 <classname>Zend_Controller_Plugin_PutHandler</classname> provides a drop-in
8 plugin for marshalling <constant>PUT</constant> request bodies into request parameters, just
9 like <constant>POST</constant> request bodies. It will inspect the request and, if
10 <constant>PUT</constant>, will use parse_str to parse the raw <constant>PUT</constant> body
11 into an array of params which is then set on the request. E.g.,
14 <programlisting language="txt"><![CDATA[
15 PUT /notes/5.xml HTTP/1.1
17 title=Hello&body=World
21 To receive the 'title' and 'body' params as regular request params,
25 <programlisting language="php"><![CDATA[
26 $front = Zend_Controller_Front::getInstance();
27 $front->registerPlugin(new Zend_Controller_Plugin_PutHandler());
31 Then you can access the <constant>PUT</constant> body params by name from the request inside
35 <programlisting language="php"><![CDATA[
37 public function putAction()
39 $title = $this->getRequest()->getParam('title'); // $title = "Hello"
40 $body = $this->getRequest()->getParam('body'); // $body = "World"