drogon
drogon copied to clipboard
Add http method conversion function
作为服务端时候,http 方法被配置在配置文件中, 需要一个转换函数将 str 转换成 HttpMethod, 打印配置时候需要将HttpMethod 转换成str
app().registerHandler(
"/hello_user",
[](const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) {
callback(resp);
},
{to_http_method("GET")});