lithium\net\http\Response::__toString()

public method

Return the response as a string.

Returns

string

Source

	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);
	}