malvik-lab/laravel-accept-only-json-response
Composer 安装命令:
composer require malvik-lab/laravel-accept-only-json-response
包简介
Block requests that don't accept json in response.
关键字:
README 文档
README
If you need in Laravel PHP Framework to serve only Json requests, this package is the solution.
Installation
$ composer require malvik-lab/laravel-accept-only-json-response
Use on your routes
Route::middleware(['malviklab-laravel-accept-only-json-response'])->group(function () { // your routes here });
Output (if the request is incorrect)
Http status code: 400 Bad Request
{
"error": "Use the \"Accept: application/json\" HTTP Header"
}
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-20