Yii2 配置接收json数据
在config目录下main.php中components参数下添加如下配置
'components' => [ 'request' => [ 'csrfParam' => '_csrf-backend', 'parsers' => [ 'application/json' => 'yii\web\JsonParser', ], ], ]
在config目录下main.php中components参数下添加如下配置
'components' => [ 'request' => [ 'csrfParam' => '_csrf-backend', 'parsers' => [ 'application/json' => 'yii\web\JsonParser', ], ], ]