/** * @param Body $body */ public static function sendRawBodyResponse(Body $body) { if (headers_sent() === false) { header_remove(); $message = sprintf("HTTP/1.0 %d %s", $body->getStatusCode(), $body->getReasonPhrase()); header($message, true, $body->getStatusCode()); } $body->sendData(); flush(); }
/** * Gets the response status code. * * The status code is a 3-digit integer result code of the server's attempt * to understand and satisfy the request. * * @return int Status code. */ public function getStatusCode() { if ($this->overridingStatusCode !== null) { return $this->overridingStatusCode; } return $this->body->getStatusCode(); }