(Yaf >=3.2.2)
Yaf_Request_Abstract::getRaw — Retrieve the raw request body
This function has no parameters.
The raw request body as a string, or null on failure.
Example #1 Yaf_Request_Abstract::getRaw() example
<?php
class ApiController extends Yaf_Controller_Abstract
{
public function createAction()
{
// Assuming the client POSTs '{"name":"yaf","version":3}'
$raw = $this->getRequest()->getRaw();
$data = json_decode($raw, true);
var_dump($data);
}
}
?>The above example will output something similar to:
array(2) {
["name"]=>
string(3) "yaf"
["version"]=>
int(3)
}