Since: 2.0
Author: Paul Klimov (klimov.paul@gmail.com)
Inheritance: extends Message
Example #1
0
 /**
  * @inheritdoc
  */
 public function parse(Response $response)
 {
     return $this->convertXmlToArray($response->getContent());
 }
Example #2
0
 /**
  * Creates a response instance.
  * @param string $content raw content
  * @param array $headers headers list.
  * @return Response request instance.
  */
 public function createResponse($content = null, array $headers = [])
 {
     $config = $this->responseConfig;
     if (!isset($config['class'])) {
         $config['class'] = Response::className();
     }
     $config['client'] = $this;
     $response = Yii::createObject($config);
     $response->setContent($content);
     $response->setHeaders($headers);
     return $response;
 }
 /**
  * @inheritdoc
  */
 public function parse(Response $response)
 {
     $data = [];
     parse_str($response->getContent(), $data);
     return $data;
 }
 /**
  * @inheritdoc
  */
 public function parse(Response $response)
 {
     return Json::decode($response->getContent());
 }
 /**
  * @inheritdoc
  */
 public function parse(Response $response)
 {
     return $response->getContent();
 }