I am trying to access request parameters made to the api url which I am setting a response for via a plugin.
The call is to: rest/default/V1/guest-carts/a9e6330920e85d09a123a396f77a9275/shipping-information
Here is the code that I am currently using, however it provides an empty array.
namespace Vendor\Onepage\Plugin;
class ShippingInformationManagementPlugin
{
protected $_request;
public function __construct(
\Magento\Framework\App\RequestInterface $request
)
{
$this->_request = $request;
}
public function beforeSaveAddressInformation(
\Magento\Checkout\Model\ShippingInformationManagement $subject,
$cartId,
\Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
)
{
var_dump($this->_request->getParams());
die('testing');
}
}