关于HTTP的post解析json

wjr

发的是这个:
{ "uuid": "111111", "actions": [ { "code": "switch", "params": { "status": 0, "volume": 0, "delay": 0 } } ]}
接收的是这个:
(
[{"uuid":_"ID8603761001-1",_"actions":_] => Array
(
[{"code": "switch", "params": {"volume": 0, "delay": 0, "status": 0}}] =>
)
)

不能正确解析

1634 3 0
3个回答

walkor
json_decode($request->rawBody());
  • 暂无评论
wjr

使用json_decode($request->rawBody());会出错提示:process C:\Users\Administrator\Desktop\server\JzgGW20201016\Applications\JzgApp\start_webapi.php terminated and try to restart

wjr

是4.X版本的,使用json_decode()就会出错,不使用就正常

  • walkor 2020-10-29

    可能是你的php不支持json

年代过于久远,无法发表回答
🔝