public function sendError($error_num, $err_str = '')
    {

        if (empty($err_str)) {
            switch ($error_num) {
                case 400:
                    $err_str = 'Bad Request';
                    break;

                case 401:
                    $err_str = 'Unauthorized';
                    break;

                case 403:
                    $err_str = 'Forbidden';
                    break;

                case 404:
                    $err_str = 'Not Found';
                    break;

                case 405:
                    $err_str = 'Method Not Allowed';
                    break;

                case 410:
                    $err_str = 'Gone';
                    break;

                case 415:
                    $err_str = 'Unsupported Media Type';
                    break;

                case 500:
                    $err_str = 'Internal Server Error';
                    break;

                case 501:
                    $err_str = 'Not Implemented';
                    break;
            }
        }
        $this->sendHeader("HTTP/1.0 $error_num $err_str");
    }