MAGENTO 2: How to get HTTP Request Params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**
* @var \Magento\Framework\App\RequestInterface
*/
protected $request;
/**
* @param \Magento\Framework\App\RequestInterface $request
*/
public function __construct(
\Magento\Framework\App\RequestInterface $request
) {
$this->request = $request;
}
/**
* @author Reena Parekh <reena1.parekh@gmail.com>
*
* @return $this
*/
protected function myCustomFunction()
{
$params = $this->request->getParams();
return $this;
}
Also Check my blogpost here on getting API Request params: http://parekhreena.blogspot.com/2020/08/magento-get-rest-api-request-params.html
Comments
Post a Comment