【发布时间】:2016-11-26 16:13:30
【问题描述】:
我无法使用 http 请求获取从 post 方法发送的值。
我正在使用 get 方法获取值,但我需要使用 post 方法获取它。
我没有使用任何视图,我想调用 http url,并使用 post 方法在我的控制器中发送一些数据。
这就是我的控制器的样子,
namespace Spaarg\eMenuApi\Controller\Index;
class Products extends \Magento\Framework\App\Action\Action
{
public function __construct(\Magento\Framework\App\Action\Context $context)
{
return parent::__construct($context);
}
public function execute()
{
//$token = $this->getRequest()->getPostValue();
$token = $this->getRequest()->getPost();
}
}
我是 magento 2 的新手,我不明白问题出在哪里。 如果有人可以提供帮助,那就太好了。
【问题讨论】: