Exemple #1
0
 /**
  * @param \Psr\Http\Message\StreamInterface|string $body
  * @param int                                      $statusCode
  * @param \Elegant\Http\Message\HeaderBag|array    $headers
  */
 public function __construct($body = '', $statusCode = 200, $headers = [])
 {
     parent::__construct($body, $headers);
     $this->setStatusCode($statusCode);
 }
Exemple #2
0
 /**
  * @param string                                   $method
  * @param \Psr\Http\Message\UriInterface|string    $uri
  * @param \Psr\Http\Message\StreamInterface|string $body
  * @param \Elegant\Http\Message\HeaderBag|array    $headers
  *
  * @throws \InvalidArgumentException For any invalid param
  */
 public function __construct($method, $uri, $body = '', $headers = [])
 {
     parent::__construct($body, $headers);
     $this->setMethod($method);
     $this->setUri($uri instanceof UriInterface ? $uri : new Uri($uri));
 }