> For the complete documentation index, see [llms.txt](https://liseen315.gitbook.io/laravel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liseen315.gitbook.io/laravel/bian-xie-apis/du-qu-he-fa-song-headers/zai-laravel-zhong-du-qu-qing-qiu-tou.md).

# 在Laravel中读取请求头

如果你获取了一个请求，也可以轻松的读取头。例如13-6所示

{% code title="Example 13-6. Reading a request header in Laravel" %}

```php
Route::get('dogs', function (Request $request) { 
    var_dump($request->header('Accept'));
});
```

{% endcode %}

现在你已经可以读取请求头以及设置响应头，让我们看看如何自定义API
