protected function _unserializeResponseBody(ResponseInterface $response) {

		$body = (string) $response->getBody();
		$contentType = $response->getHeaderLine('Content-type');

		try {
			if(false !== stripos($contentType, $this->dataType)
				&& isset($this->unserializers[$this->dataType])) {
				/** @var UnserializerInterface $unserializer */
				$unserializer = \Yii::createObject($this->unserializers[$this->dataType]);
				if($unserializer instanceof UnserializerInterface) {
					return $unserializer->unserialize($body, false);
				}
			}

			return $body;

		} catch(InvalidParamException $e) {

			return $body;
		}
	}
protected function _unserializeResponseBody(ResponseInterface $response) {

		$body = (string) $response->getBody();
		$contentType = $response->getHeaderLine('Content-type');

		try {
			if(false !== stripos($contentType, $this->dataType)
				&& isset($this->unserializers[$this->dataType])) {
				/** @var UnserializerInterface $unserializer */
				$unserializer = \Yii::createObject($this->unserializers[$this->dataType]);
				if($unserializer instanceof UnserializerInterface) {
					return $unserializer->unserialize($body, false);
				}
			}

			return $body;

		} catch(InvalidParamException $e) {

			return $body;
		}
	}
protected function _unserializeResponseBody ( ResponseInterface $ response ) { $ body = ( string ) $ response -> getBody ( ) ; $ contentType = $ response -> getHeaderLine ( 'Content-type' ) ; try { if ( false !== stripos ( $ contentType , $ this -> dataType ) && isset ( $ this -> unserializers [ $ this -> dataType ] ) ) { /** @var UnserializerInterface $unserializer */ $ unserializer = \ Yii :: createObject ( $ this -> unserializers [ $ this -> dataType ] ) ; if ( $ unserializer instanceof UnserializerInterface ) { return $ unserializer -> unserialize ( $ body , false ) ; } } return $ body ; } catch ( InvalidParamException $ e ) { return $ body ; } }
Try to unserialize response body data
@param ResponseInterface $response
@return object[]|object|string
@throws \yii\base\InvalidConfigException
Try to unserialize response body data