I am getting get parameters using this
$this->params()->fromQuery('KEY');
I found two way to get POST parameters
//first way
$this->params()->fromPost('KEY', null);
//second way
$this->getRequest()->getPost();
Both of this working in "POST" method but now in a "PUT" method if I pass values as a post parameters.
How I can get post parameters in "PUT" method?
You need to read the request body and parse it, something like this:
This will parse all params into the
$putParams
-array, so you can access it like you would access the super globals$_POST
or$_GET
. For instance: