public function send(Response $response): void
    {
        // send http header:
        $httpHeader = sprintf(
            'HTTP/%s %d %s',
            $response->getProtocolVersion(),
            $response->getStatus(),
            $response->getStatusMessage()
        );
        header($httpHeader, true);

        // send additional headers:
        foreach ($response->getHeaders() as $name => $value) {
            header(sprintf('%s: %s', $name, $value), true);
        }

        // send body:
        echo $response->getBody();
    }
public function send(Response $response): void
    {
        // send http header:
        $httpHeader = sprintf(
            'HTTP/%s %d %s',
            $response->getProtocolVersion(),
            $response->getStatus(),
            $response->getStatusMessage()
        );
        header($httpHeader, true);

        // send additional headers:
        foreach ($response->getHeaders() as $name => $value) {
            header(sprintf('%s: %s', $name, $value), true);
        }

        // send body:
        echo $response->getBody();
    }
public function send ( Response $ response ) : void { // send http header: $ httpHeader = sprintf ( 'HTTP/%s %d %s' , $ response -> getProtocolVersion ( ) , $ response -> getStatus ( ) , $ response -> getStatusMessage ( ) ) ; header ( $ httpHeader , true ) ; // send additional headers: foreach ( $ response -> getHeaders ( ) as $ name => $ value ) { header ( sprintf ( '%s: %s' , $ name , $ value ) , true ) ; } // send body: echo $ response -> getBody ( ) ; }
Sends response to client.

@param Response $response
@return void
Sends response to client .