src/Peach/Http/DefaultEndpoint.php
public function send(Response $response)
    {
        $body = $response->getBody();
        if ($body instanceof Body) {
            $renderer = $body->getRenderer();
            $value    = $body->getValue();
            $result   = $renderer->render($value);
            $response->setHeader(new Raw("Content-Length", strlen($result)));
        } else {
            $result   = null;
        }
        
        foreach ($response->getHeaderList() as $header) {
            if ($header instanceof Status) {
                $code         = $header->getCode();
                $reasonPhrase = $header->getReasonPhrase();
                header("HTTP/1.1 {$code} {$reasonPhrase}");
                continue;
            }
            $name  = $header->getName();
            $value = $header->format();
            $this->printHeader($name, $value);
        }
        if (strlen($result)) {
            echo $result;
        }
    }
public function send(Response $response)
    {
        $body = $response->getBody();
        if ($body instanceof Body) {
            $renderer = $body->getRenderer();
            $value    = $body->getValue();
            $result   = $renderer->render($value);
            $response->setHeader(new Raw("Content-Length", strlen($result)));
        } else {
            $result   = null;
        }
        
        foreach ($response->getHeaderList() as $header) {
            if ($header instanceof Status) {
                $code         = $header->getCode();
                $reasonPhrase = $header->getReasonPhrase();
                header("HTTP/1.1 {$code} {$reasonPhrase}");
                continue;
            }
            $name  = $header->getName();
            $value = $header->format();
            $this->printHeader($name, $value);
        }
        if (strlen($result)) {
            echo $result;
        }
    }
指定された Response オブジェクトを header() や echo()
などを使ってクライアントに送信します.

@param Response $response 送信対象の Response オブジェクト