public function copyToHttpResponse(ResponseInterface $httpResponse)
    {

        // create a local copy of the response
        $servletResponse = $this->servletResponse;

        // copy response values to the HTTP response
        $httpResponse->setStatusCode($servletResponse->getStatusCode());
        $httpResponse->setStatusReasonPhrase($servletResponse->getStatusReasonPhrase());
        $httpResponse->setVersion($servletResponse->getVersion());
        $httpResponse->setState($servletResponse->getState());

        // copy the body content to the HTTP response
        $httpResponse->appendBodyStream($servletResponse->getBodyStream());

        // copy headers to the HTTP response
        foreach ($servletResponse->getHeaders() as $headerName => $headerValue) {
            $httpResponse->addHeader($headerName, $headerValue);
        }

        // copy cookies to the HTTP response
        $httpResponse->setCookies($servletResponse->getCookies());
    }
public function copyToHttpResponse(ResponseInterface $httpResponse)
    {

        // create a local copy of the response
        $servletResponse = $this->servletResponse;

        // copy response values to the HTTP response
        $httpResponse->setStatusCode($servletResponse->getStatusCode());
        $httpResponse->setStatusReasonPhrase($servletResponse->getStatusReasonPhrase());
        $httpResponse->setVersion($servletResponse->getVersion());
        $httpResponse->setState($servletResponse->getState());

        // copy the body content to the HTTP response
        $httpResponse->appendBodyStream($servletResponse->getBodyStream());

        // copy headers to the HTTP response
        foreach ($servletResponse->getHeaders() as $headerName => $headerValue) {
            $httpResponse->addHeader($headerName, $headerValue);
        }

        // copy cookies to the HTTP response
        $httpResponse->setCookies($servletResponse->getCookies());
    }
public function copyToHttpResponse ( ResponseInterface $ httpResponse ) { // create a local copy of the response $ servletResponse = $ this -> servletResponse ; // copy response values to the HTTP response $ httpResponse -> setStatusCode ( $ servletResponse -> getStatusCode ( ) ) ; $ httpResponse -> setStatusReasonPhrase ( $ servletResponse -> getStatusReasonPhrase ( ) ) ; $ httpResponse -> setVersion ( $ servletResponse -> getVersion ( ) ) ; $ httpResponse -> setState ( $ servletResponse -> getState ( ) ) ; // copy the body content to the HTTP response $ httpResponse -> appendBodyStream ( $ servletResponse -> getBodyStream ( ) ) ; // copy headers to the HTTP response foreach ( $ servletResponse -> getHeaders ( ) as $ headerName => $ headerValue ) { $ httpResponse -> addHeader ( $ headerName , $ headerValue ) ; } // copy cookies to the HTTP response $ httpResponse -> setCookies ( $ servletResponse -> getCookies ( ) ) ; }
Copies the values from the request handler back to the passed HTTP response instance.

@param \AppserverIo\Psr\HttpMessage\ResponseInterface $httpResponse A HTTP response object

@return void
Copies the values from the request handler back to the passed HTTP response instance .