lithium\net\http\Response::__toString()
Overrides
lithium\net\Message::__toString()
Return the response as a string.
Returns
stringSource
public function __toString() {
if ($type = $this->headers('Content-Type')) {
$this->headers('Content-Type', "{$type};charset={$this->encoding}");
}
if ($cookies = $this->_cookies()) {
$this->headers('Set-Cookie', $cookies);
}
$body = join("\r\n", (array) $this->body);
$headers = join("\r\n", $this->headers());
$response = [$this->status(), $headers, "", $body];
return join("\r\n", $response);
}