Наследование: extends Symfony\Component\HttpFoundation\Response
Пример #1
0
 /**
  * @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);
 }
Пример #2
0
 /**
  * @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);
 }
Пример #3
0
 /**
  * @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);
 }
Пример #4
0
 /**
  * @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);
 }