/** * Creates a response. * * @param integer $statusCode The status code. * @param string $reasonPhrase The reason phrase. * @param string $protocolVersion The protocol version. * @param array $headers The headers. * @param \Psr\Http\Message\StreamableInterface|null $body The body. * @param array $parameters The parameters. */ public function __construct($statusCode = 200, $reasonPhrase = 'OK', $protocolVersion = self::PROTOCOL_VERSION_1_1, array $headers = array(), StreamableInterface $body = null, array $parameters = array()) { parent::__construct($protocolVersion, $headers, $body, $parameters); $this->statusCode = $statusCode; $this->reasonPhrase = $reasonPhrase; }
/** * Creates a request. * * @param string|object $url The url. * @param string $method The method. * @param string $protocolVersion The protocol version. * @param array $headers The headers. * @param \Psr\Http\Message\StreamableInterface|null $body The body. * @param array $parameters The parameters. */ public function __construct($url, $method = self::METHOD_GET, $protocolVersion = self::PROTOCOL_VERSION_1_1, array $headers = array(), StreamableInterface $body = null, array $parameters = array()) { parent::__construct($protocolVersion, $headers, $body, $parameters); $this->setUrl($url); $this->setMethod($method); }