예제 #1
0
 /**
  * Create a new Request.
  *
  * @see WellRESTed\Message\Message
  * @param UriInterface $uri
  * @param string $method
  * @param array $headers
  * @param StreamInterface $body
  */
 public function __construct(UriInterface $uri = null, $method = "GET", array $headers = null, StreamInterface $body = null)
 {
     parent::__construct($headers, $body);
     if ($uri !== null) {
         $this->uri = $uri;
     } else {
         $this->uri = new Uri();
     }
     $this->method = $method;
 }
예제 #2
0
 /**
  * Create a new Response, optionally with status code, headers, and a body.
  *
  * If provided, $headers MUST by an associative array with header field
  * names as (string) keys and lists of header field values (string[])
  * as values.
  *
  * If no StreamInterface is provided for $body, the instance will create
  * a NullStream instance for the message body.
  *
  * @see WellRESTed\Message\Message
  * @param int $statusCode
  * @param array $headers
  * @param StreamInterface $body
  */
 public function __construct($statusCode = 500, array $headers = null, StreamInterface $body = null)
 {
     parent::__construct($headers, $body);
     $this->statusCode = $statusCode;
     $this->reasonPhrase = $this->getDefaultReasonPhraseForStatusCode($statusCode);
 }