zendframework/zf2 — pull request #1913 by davidwindell (2012-07-17 20:06:58+00:00)
Title: [Mvc] Separate handling of Restful Data

This PR allows for easy/cleaner extension of the AbstractResfulController for handling multiple input types, for example the following based on the Content-Type header;

```php
class MyAbstractRestfulController extends AbstractRestfulController
{
public function processInputData(Request $request)
{
$contentType = $request->getHeaders()->get('Content-Type')->getFieldValue();
$rawBody = $request->getContent();

switch ($contentType) {
case 'application/json':
return Json::decode($rawBody, Json::TYPE_ARRAY);
break;
case 'application/xml':
$xml = new Reader\Xml();
return $xml->fromString($rawBody);
break;
default:
return parent::processInputData($request);
break;
}
}
}
```