Пример #1
0
 /**
  * Extend current response with another.
  *
  * @param IHttpResponse $response
  */
 public function extend(IHttpResponse $response)
 {
     $this->setHeaders(clone $response->getHeaders());
     $this->setProtocol($response->getProtocol());
     $this->setProtocolVersion($response->getProtocolVersion());
     $this->setStatusCode($response->getStatusCode());
     $this->setContent($response->getContent());
     $this->setCookies(clone $response->getCookies());
     $this->setDefaultContentType();
 }
Пример #2
0
 /**
  * @param IHttpResponse $response
  *
  * @return string
  */
 public function createRequestDefinition(IHttpResponse $response)
 {
     return s('%s/%s %d %s', $response->getProtocol(), $response->getProtocolVersion(), $response->getStatusCode(), $response->getStatusText());
 }