MAGENTO 2: How to get HTTP Request Params


/**
* @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;
}
view raw HttpParams.php hosted with ❤ by GitHub


Also Check my blogpost here on getting API Request params: http://parekhreena.blogspot.com/2020/08/magento-get-rest-api-request-params.html

Comments

Popular posts from this blog

SEO for your Press Releases [Updated 2025 list]

XDebug - PHPStorm - Mac: How to configure Xdebug with PHPStorm on Mac OS and PHP 7.3