/** * @param string $location The value of the Location header * @param mixed $content The response content, see setContent() * @param array $headers An array of response headers * * @throws \InvalidArgumentException When the HTTP status code is not valid * * @api */ public function __construct($location, $content = '', $headers = []) { parent::__construct($content, Response::HTTP_CREATED, $headers); $this->headers->set('Location', $location); }
/** * @param mixed $content The response content, see setContent() * @param array $headers An array of response headers * * @throws \InvalidArgumentException When the HTTP status code is not valid * * @api */ public function __construct($content = '', $headers = []) { parent::__construct($content, Response::HTTP_OK, $headers); }
/** * @param string $contentLocation The value of the Content-Location header * @param string $eTag The value of the Etag header * @param array $headers An array of response headers * * @throws \InvalidArgumentException When the HTTP status code is not valid * * @api */ public function __construct($contentLocation, $eTag, $headers = []) { parent::__construct('', Response::HTTP_NOT_MODIFIED, $headers); $this->headers->set('Content-Location', $contentLocation); $this->headers->set('Etag', $eTag); }
/** * @param array $headers An array of response headers * * @throws \InvalidArgumentException When the HTTP status code is not valid * * @api */ public function __construct($headers = []) { parent::__construct('', Response::HTTP_NO_CONTENT, $headers); }