Skip to content
PHP Ecosystem
Explore

RequestParserInterface

API reference › yii › web › RequestParserInterface

interfaceyii\web\RequestParserInterface
Since2.0
Sourceframework/web/RequestParserInterface.php
Implemented by 2 types

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

MethodDescriptionDefined by
parse() abstractParses a HTTP request body.RequestParserInterface
abstract public function parse(string $rawBody, string $contentType): mixed

Parses a HTTP request body.

Parameters

ParameterTypeDescription
$rawBodystringThe raw HTTP request body.
$contentTypestringThe content type specified for the request body.

Returns

mixed: Parameters parsed from the request body