You are here

public function Request::__toString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Request.php \Symfony\Component\HttpFoundation\Request::__toString()

Returns the request as a string.

Return value

string The request

File

vendor/symfony/http-foundation/Request.php, line 492

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function __toString() {
  try {
    $content = $this
      ->getContent();
  } catch (\LogicException $e) {
    return trigger_error($e, E_USER_ERROR);
  }
  return sprintf('%s %s %s', $this
    ->getMethod(), $this
    ->getRequestUri(), $this->server
    ->get('SERVER_PROTOCOL')) . "\r\n" . $this->headers . "\r\n" . $content;
}