-1

I am creating Extention and I need to send posts and get requests. I want to fetch that variables values that are sent using get or post method.

2

For single parameter, use:

$req = $this->getRequest()->getParam('param_name');

For all parameters, use:

$req = $this->getRequest()->getParams();

Hope it works!

0

for post method you get values

$posts = $this->getRequest()->getPostValue();
print_r($posts);

for get method you get values

$gets = $this->getRequest()->getParams();
print_r($gets);

for single get value

$gets = $this->getRequest()->getParam('variable_name');
print_r($gets);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.