Class yii\httpclient\UrlEncodedParser

Inheritanceyii\httpclient\UrlEncodedParser » yii\base\BaseObject
Implementsyii\httpclient\ParserInterface
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-httpclient/blob/master/src/UrlEncodedParser.php

UrlEncodedParser parses HTTP message content as 'application/x-www-form-urlencoded'.

Public Methods

Hide inherited methods

Method Description Defined By
parse() Parses given HTTP response instance. yii\httpclient\UrlEncodedParser

Method Details

Hide inherited methods

parse() public method

Parses given HTTP response instance.

public mixed parse ( yii\httpclient\Response $response )
$response yii\httpclient\Response

HTTP response instance.

return mixed

Parsed content data.

                public function parse(Response $response)
{
    $data = [];
    parse_str($response->getContent(), $data);
    return $data;
}