Ejemplo n.º 1
0
 public function testAddsPortToHeader()
 {
     $request = new Request('http://foo.com:8124/bar', 'GET');
     $this->assertEquals('foo.com:8124', $request->getHeaderLine('host'));
 }
Ejemplo n.º 2
0
 /**
  * Create a new server request instance.
  *
  * @param null|string|UriInterface             $uri          URI for the request.
  * @param string|null                          $method       HTTP method for the request.
  * @param array                                $headers      Headers for the message.
  * @param string|null|resource|StreamInterface $body         Message body.
  * @param string                               $version      HTTP protocol version.
  * @param array                                $serverParams Typically the $_SERVER superglobal
  */
 public function __construct($uri, $method = 'GET', array $headers = [], $body = null, string $version = '1.1', array $serverParams = [])
 {
     $this->serverParams = $serverParams;
     parent::__construct($uri, $method, $headers, $body, $version);
 }