# RequestParserInterface

> Interface for classes that parse the raw request body into a parameters array.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [web](/docs/api/yii/web/index.md) › RequestParserInterface

| interface | `yii\web\RequestParserInterface` |
| --- | --- |
| Since | 2.0 |
| Source | [`framework/web/RequestParserInterface.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/web/RequestParserInterface.php#L17) |

Implemented by 2 types:

- [`JsonParser`](/docs/api/yii/web/jsonparser/index.md)
- [`MultipartFormDataParser`](/docs/api/yii/web/multipartformdataparser/index.md)

Interface for classes that parse the raw request body into a parameters array.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`parse()`](#method-parse) abstract | Parses a HTTP request body. | `RequestParserInterface` |

## Method details

### parse() <span id="method-parse"></span>

```php
abstract public function parse(string $rawBody, string $contentType): mixed
```

Parses a HTTP request body.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rawBody` | `string` | The raw HTTP request body. |
| `$contentType` | `string` | The content type specified for the request body. |

**Returns**

`mixed`: Parameters parsed from the request body