Example #1
0
 /**
  * Constructor.
  *
  * @param string                $uri
  * @param \http\Client\Response $response
  */
 public function __construct($uri, \http\Client\Response $response)
 {
     try {
         $parent = $response->getParentMessage();
         $location = $parent->getHeader('Location');
         $this->uri = $location;
     } catch (HttpRuntimeException $e) {
         $this->uri = $uri;
     }
     $this->httpVersion = $response->getHttpVersion();
     $this->code = $response->getResponseCode();
     $this->_response = $response;
     foreach ($response->getHeaders() as $k => $v) {
         $this->headers[strtolower($k)] = $v;
     }
 }