编程语言
首页 > 编程语言> > [0] InvalidArgumentException in Response.php line 316, variable type error: object

[0] InvalidArgumentException in Response.php line 316, variable type error: object

作者:互联网

描述: TP5 的时候报错
[0] InvalidArgumentException in Response.php line 316, variable type error: object

[0] InvalidArgumentException in Response.php line 316, variable type error: object
问题解决:
[0] InvalidArgumentException in Response.php line 316, variable type error: object
返回的数据应该要用json化
在这里插入代码片;

    $content = file_get_contents('./testjson/test9.json');
    $data = json_decode($content);
    return json($data);

再次访问接口即可生效
[0] InvalidArgumentException in Response.php line 316, variable type error: object

标签:object,316,content,json,variable,php,type
来源: https://blog.csdn.net/qq_38192709/article/details/122513229