GuzzleHttp\Psr7\Response::__construct PHP Method

__construct() public method

public __construct ( integer $status = 200, array $headers = [], string | null | resource | Psr\Http\Message\StreamInterface $body = null, string $version = '1.1', string | null $reason = null )
$status integer Status code
$headers array Response headers
$body string | null | resource | Psr\Http\Message\StreamInterface Response body
$version string Protocol version
$reason string | null Reason phrase (when empty a default will be used based on the status code)
    public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null)
    {
        $this->statusCode = (int) $status;
        if ($body !== '' && $body !== null) {
            $this->stream = stream_for($body);
        }
        $this->setHeaders($headers);
        if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
            $this->reasonPhrase = self::$phrases[$this->statusCode];
        } else {
            $this->reasonPhrase = (string) $reason;
        }
        $this->protocol = $version;
    }