src/Response.php
public function render()
    {
        Base::getLog()->debug(__METHOD__ . ' render response object');

        if ( ! $this->headers('content-type'))
        {
            $this->headers('content-type', Base::$contentType . '; charset=' . $this->charset);
        }

        $this->headers('content-length', (string) $this->contentLength);

        if (Base::$expose)
        {
            $this->headers('user-agent', Base::version());
        }

        if ($this->cookies)
        {
            if (extension_loaded('http'))
            {
                $this->headers('set-cookie', http_build_cookie($this->cookies));
            }
            else
            {
                $cookies = [];
                foreach ($this->cookies as $key => $value)
                {
                    $string = $key . '=' . $value['value'] . '; expires=' . date('l, d M Y H:i:s T', $value['expiration']);
                    $cookies[] = $string;
                }
                $this->headers('set-cookie', $cookies);
            }
        }

        $output = $this->protocol
            . ' '
            . $this->status
            . ' '
            . Arr::get(Http::$text, $this->status)
            . "\r\n";
        $output .= $this->message->headerLines;
        $output .= $this->message->body;

        return $output;
    }
public function render()
    {
        Base::getLog()->debug(__METHOD__ . ' render response object');

        if ( ! $this->headers('content-type'))
        {
            $this->headers('content-type', Base::$contentType . '; charset=' . $this->charset);
        }

        $this->headers('content-length', (string) $this->contentLength);

        if (Base::$expose)
        {
            $this->headers('user-agent', Base::version());
        }

        if ($this->cookies)
        {
            if (extension_loaded('http'))
            {
                $this->headers('set-cookie', http_build_cookie($this->cookies));
            }
            else
            {
                $cookies = [];
                foreach ($this->cookies as $key => $value)
                {
                    $string = $key . '=' . $value['value'] . '; expires=' . date('l, d M Y H:i:s T', $value['expiration']);
                    $cookies[] = $string;
                }
                $this->headers('set-cookie', $cookies);
            }
        }

        $output = $this->protocol
            . ' '
            . $this->status
            . ' '
            . Arr::get(Http::$text, $this->status)
            . "\r\n";
        $output .= $this->message->headerLines;
        $output .= $this->message->body;

        return $output;
    }
渲染当前响应对象

@return string