精简HttpServer代码

This commit is contained in:
xia-chu
2023-06-10 10:16:45 +08:00
committed by 夏楚
parent fff53cf0e2
commit 52c7bc1d34
5 changed files with 28 additions and 41 deletions

View File

@@ -15,19 +15,25 @@
namespace mediakit{
/**
* 根据http错误代码获取字符说明
* @param status 譬如404
* @return 错误代码字符说明譬如Not Found
*/
const char *getHttpStatusMessage(int status);
class HttpConst {
public:
HttpConst() = delete;
~HttpConst() = delete;
/**
* 根据文件后缀返回http mime
* @param name 文件后缀譬如html
* @return mime值譬如text/html
*/
const std::string &getHttpContentType(const char *name);
/**
* 根据http错误代码获取字符说明
* @param status 譬如404
* @return 错误代码字符说明譬如Not Found
*/
static const char *getHttpStatusMessage(int status);
/**
* 根据文件后缀返回http mime
* @param name 文件后缀譬如html
* @return mime值譬如text/html
*/
static const std::string &getHttpContentType(const char *name);
};
}//mediakit