返回空字符串
打印后可见对象参数
<pre>ob
["options":protected] => array(1) {
["json_encode_param"] => int(256)
}
["contentType":protected] => string(16) "application/json"
["data":protected] => string(5) "hello"
["charset":protected] => string(5) "utf-8"
["code":protected] => int(200)
["header":protected] => array(1) {
["Content-Type"] => string(31) "application/json; charset=utf-8"
}
["content":protected] => NULL
}
</pre>"
所以应该怎么处理?
protected function response($data, $type = 'json', $code = 200)
{
return Response::create($data, $type)->code($code);
}
最佳答案
