From a web app i use curl to send a POST request to my api, $params is an array with 3 variables,uname, email and type
$POSTFIELDS = http_build_query($params); curl_setopt($ch, CURLOPT_POSTFIELDS, $POSTFIELDS);
//On the api side - $uname is always empty, email and type
$uname = $this->di['request']->getPost("uname"); $email = $this->di['request']->getPost("email"); $type = $this->di['request']->getPost("type");
However $this->di['request']->getRawBody() gives me
uname=aa&email=el%40emanonlabs.com&type=aa
how do you access individual post variables? or do i have to explode($params, '=') selectively on getRawBody() IF it is a curl request ? is there a cleaner way?