laravel 浏览器谷歌network返回报错html
2021-03-12 16:28
阅读:612
标签:html fun and cti except img handler work request
laravel 在谷歌报错的时候会返回html,对于调试来说很不方便。
原因是在于:
这里返回的格式是json,但是报错时候返回的是整个html
所以
相对路径: app\Exceptions\Handler.php
public function render($request, Exception $exception) { $response = parent::render($request, $exception); $response->header(‘Content-Type‘,‘text/html;charset=utf-8‘); return $response; }
在handler.php里面的这个方法改一下就可以了
laravel 浏览器谷歌network返回报错html
标签:html fun and cti except img handler work request
原文地址:https://www.cnblogs.com/chenrunxuan/p/12826301.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:laravel 浏览器谷歌network返回报错html
文章链接:http://soscw.com/index.php/essay/63750.html
文章标题:laravel 浏览器谷歌network返回报错html
文章链接:http://soscw.com/index.php/essay/63750.html
评论
亲,登录后才可以留言!