# 请求对象

Illuminate\Http\Request 是Symfony’s HttpFoundation\Request的特殊扩展。

> Symfony HttpFoundation
>
> 如果你不熟悉的话, 其实Symfony’s HttpFoundation 现在几乎支持所有的PHP框架; 它是PHP中最流行的一组抽象，用于表示HTTP请求，响应，头，cookies等

请求对象代表你关心的用户HTTP请求。

在原生PHP代码中，你可能会发现$\_SERVER, $\_GET, $\_POST，以及其他全局的组合用于获取当前用户的请求，用户上传了什么文件？他们的IP地址是？他们提交了什么字段？这一堆充斥在整个代码中，而且难以理解。

Symfony 的请求对象将HTTP请求封装成一个单独的对象，然后附加了一些方便的方法用于获取信息，Illuminate请求对象添加了更多的方法用于方便获取信息。

> 捕获请求
>
> 在Laravel应用中你可能永远不需要这样做，但如果你要在PHP全局捕获Illuminate请求，你可以使用capture()方法。

> $request = Illuminate\Http\Request::capture();


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liseen315.gitbook.io/laravel/qing-qiu-xiang-ying-he-zhong-jian-jian/qing-qiu-dui-xiang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
