Пример #1
0
 public function __construct($method, UriInterface $uri, array $headers = [], $body = null, $version = '1.1', $reasonPhrase = null)
 {
     parent::__construct($headers, $body, $version, $reasonPhrase);
     $this->method = strtoupper($method);
     $this->uri = $uri;
     $host = $uri->getHost();
     if ($host && !$this->hasHeader('Host')) {
         if ($port = $uri->getPort()) {
             $host .= ':' . $port;
         }
         $this->headers['Host'] = $host;
     }
 }
Пример #2
0
 public function __construct($code = 200, array $headers = [], $body = 'php://memory', $version = '1.1', $reasonPhrase = null)
 {
     parent::__construct($headers, $body, $version, $reasonPhrase);
     $this->code = $code;
 }