yii\httpclient\Client::createResponse PHP Method

createResponse() public method

Creates a response instance.
public createResponse ( string $content = null, array $headers = [] ) : Response
$content string raw content
$headers array 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;
    }