private function sendHeaders()
    {
        if (!array_key_exists('Content-Type', $this->headers)) {
            $this->headers['Content-Type'] = 'text/html; charset=UTF-8';
        }

        $this->headers['Content-Length'] = strlen($this->body);

        header(
            sprintf(
                'HTTP/%s %s %s',
                $this->request->server('SERVER_PROTOCOL'),
                $this->numericStatusCode,
                $this->textualStatusCode ?: $this->statusCode->getText($this->numericStatusCode)
            ),
            true,
            $this->numericStatusCode
        );

        foreach ($this->headers as $key => $value) {
            header(sprintf('%s: %s', $key, $value));
        }
    }