HTTPRequest::send_response PHP Method

send_response() protected method

protected send_response ( $code, array $headers = [], $body = null )
$headers array
    protected function send_response($code, array $headers = array(), $body = null)
    {
        // send out response line
        $this->send_line($code);
        // set content length of body exists and is not already set
        if ($body && !isset($headers['Content-Length'])) {
            $headers['Content-Length'] = strlen($body);
        }
        // send out headers
        $this->send_headers($code, $headers);
        // send body
        // prefixed with an empty line
        JAXLLogger::debug("sending out HTTP_CRLF prefixed body");
        if ($body) {
            $this->send_body(HTTPServer::HTTP_CRLF . $body);
        }
    }