使用版本 Laravel 5.2

获取头部信息

$request->header('authorization')

直接使用 $request->header() 获取所有参数,但每个参数值都是数组格式 ['xxx']。

获取 JSON 格式数据

$request->input()

相当于 $data = file_get_content('php://input') + json_decode($data, true);

文章目录