> For the complete documentation index, see [llms.txt](https://sw-fw-less.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sw-fw-less.gitbook.io/project/mvc/request.md).

# Request

The request object can be accessed in your router handler.

### Context Info

* Swoole Request
* Get Parameter
* Post Parameter
* File Parameter
* Request Parameter(Get、Post、File parameter)
* All Request Parameters
* Header
* Server Environment Variable
* Request Method
* Request URI
* Query String
* HTTP Body

### Example

```
// Fetch Swoole Request
$this->getRequest()->getSwRequest();

// Fetch Get Parameter
$this->getRequest()->get('foo');

// Fetch Post Parameter
$this->getRequest()->post('foo');

// Fetch File Parameter
$this->getRequest()->file('foo');

// Fetch Request Parameter
$this->getRequest()->param('foo');

// Fetch All Request Parameters
$this->getRequest()->all();

// Fetch Header
$this->getRequest()->header('foo');

// Fetch Server Environment Variable
$this->getRequest()->server('foo');

// Fetch Request Method
$this->getRequest()->method();

// Fetch Request URI
$this->getRequest()->uri();

// Fetch Query String
$this->getRequest()->queryString();

// Fetch HTTP Body
$this->getRequest()->body();
```
