I have a Zend framework Controller as below.
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
class myDataController extends AbstractActionController
{
public function indexAction()
{
return array();
}
public function viewHandlerAction()
{
echo $_REQUEST['value'];
$json = new JsonModel(array("abc"=>"1"));
return $json;
}
}
I am making a HTTP post request to this "viewHandlerAction" method with some data as below.
$http({
method : "POST",
url : "myData/my-data/viewHandler",
data : JSON.stringify(formData)
}).
then(function(response) {
//console.log(response);
}, function(response) {
//console.log(response);
});
I can send this request and receive the data from the controller without any problem.But I can not access the data(formData) I sent from the client side.
Where have I done wrong?