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
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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