public function encode() { return sprintf("HTTP/%s %d %s\r\n%s\r\n%s", $this->getProtocolVersion(), $this->getStatusCode(), $this->getReasonPhrase(), $this->encodeHeaders($this->getHeaders()), (string) $this->getBody()); }