Extends
lithium\net\http\Message
Return the response as a string.
Returns
stringSource
public function __toString() {
if ($this->type != 'text/html' && !isset($this->headers['Content-Type'])) {
$this->headers['Content-Type'] = $this->type;
}
$first = "{$this->protocol} {$this->status['code']} {$this->status['message']}";
$response = array($first, join("\r\n", $this->headers()), "", $this->body());
return join("\r\n", $response);
}