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

Breadcrumb

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

function Response::__toString

Same name in this branch
  1. 11.1.x vendor/symfony/browser-kit/Response.php \Symfony\Component\BrowserKit\Response::__toString()

Returns the Response as an HTTP string.

The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before.

See also

prepare()

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function __toString() : string {
    return \sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText) . "\r\n" . $this->headers . "\r\n" . $this->getContent();
}
RSS feed
Powered by Drupal