PHP Класс yii\web\JsonParser

To enable parsing for JSON requests you can configure [[Request::parsers]] using this class: php 'request' => [ 'parsers' => [ 'application/json' => 'yii\web\JsonParser', ] ]
С версии: 2.0
Автор: Dan Schmidt ([email protected])
Наследование: implements yii\web\RequestParserInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$asArray whether to return objects in terms of associative arrays.
$throwException whether to throw a BadRequestHttpException if the body is invalid json

Открытые методы

Метод Описание
parse ( string $rawBody, string $contentType ) : array Parses a HTTP request body.

Описание методов

parse() публичный Метод

Parses a HTTP request body.
public parse ( string $rawBody, string $contentType ) : array
$rawBody string the raw HTTP request body.
$contentType string the content type specified for the request body.
Результат array parameters parsed from the request body

Описание свойств

$asArray публичное свойство

whether to return objects in terms of associative arrays.
public $asArray

$throwException публичное свойство

whether to throw a BadRequestHttpException if the body is invalid json
public $throwException