1.默认框架接收的是x-www-format-unencode格式的数据,如果想要接收text/json格式的数据,会为空,这个时候需要在配置文件中添加对应的配置项

commonents:

'request' => [  
    'enableCookieValidation' => false,  
    'parsers' => [  
        'application/json' => 'yii\web\JsonParser',  
        'text/json' => 'yii\web\JsonParser',  
    ]  
], 

 

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2021-09-15
  • 2021-08-15
  • 2021-08-23
  • 2022-01-14
  • 2022-02-02
相关资源
相似解决方案