Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Response.php

function Response::__construct

Same name in this branch
  1. 11.1.x vendor/composer/composer/src/Composer/Util/Http/Response.php \Composer\Util\Http\Response::__construct()
  2. 11.1.x vendor/guzzlehttp/psr7/src/Response.php \GuzzleHttp\Psr7\Response::__construct()
  3. 11.1.x vendor/symfony/browser-kit/Response.php \Symfony\Component\BrowserKit\Response::__construct()

Parameters

int $status The HTTP status code (200 "OK" by default):

Throws

\InvalidArgumentException When the HTTP status code is not valid

18 calls to Response::__construct()
BinaryFileResponse::__construct in vendor/symfony/http-foundation/BinaryFileResponse.php
BinaryFileResponse::__construct in vendor/symfony/http-foundation/BinaryFileResponse.php
EnforcedResponse::__construct in core/lib/Drupal/Core/Form/EnforcedResponse.php
Constructs an enforced response.
EnforcedResponse::__construct in core/lib/Drupal/Core/Form/EnforcedResponse.php
Constructs an enforced response.
HtmlResponse::__construct in core/lib/Drupal/Core/Render/HtmlResponse.php
Constructs a HtmlResponse object.

... See full list

9 methods override Response::__construct()
BinaryFileResponse::__construct in vendor/symfony/http-foundation/BinaryFileResponse.php
EnforcedResponse::__construct in core/lib/Drupal/Core/Form/EnforcedResponse.php
Constructs an enforced response.
HtmlResponse::__construct in core/lib/Drupal/Core/Render/HtmlResponse.php
Constructs a HtmlResponse object.
JsonResponse::__construct in vendor/symfony/http-foundation/JsonResponse.php
ModifiedResourceResponse::__construct in core/modules/rest/src/ModifiedResourceResponse.php
Constructor for ModifiedResourceResponse objects.

... See full list

File

vendor/symfony/http-foundation/Response.php, line 200

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function __construct(?string $content = '', int $status = 200, array $headers = []) {
    $this->headers = new ResponseHeaderBag($headers);
    $this->setContent($content);
    $this->setStatusCode($status);
    $this->setProtocolVersion('1.0');
}
RSS feed
Powered by Drupal