Ejemplo n.º 1
0
 protected function convertResponse(ResponseInterface $psrResponse, Request $request)
 {
     $request->setContentType($psrResponse->getHeaderLine('Content-Type'));
     $this->response->request = $request;
     $this->response->version = $psrResponse->getProtocolVersion();
     $this->response->setStatusCode($psrResponse->getStatusCode(), $psrResponse->getReasonPhrase());
     foreach ($psrResponse->getHeaders() as $name => $value) {
         $this->response->getHeaders()->setDefault($name, $value);
     }
     $this->response->content = $psrResponse->getBody()->getContents();
     return $this->response;
 }