📜  laravel 检查请求是否需要json - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:28.005000             🧑  作者: Mango

代码示例1
extends the Symfony\Component\HttpFoundation\Request 

Determine If The Request Is Asking For JSON
if (Request::wantsJson())
{
    //
}