Skip to content

Conversation

fantasy-peak
Copy link
Contributor

No description provided.

@fantasy-peak fantasy-peak force-pushed the add-convert-http-method branch from 39707c0 to b35fd20 Compare June 30, 2023 07:50
@nqf
Copy link

nqf commented Jun 30, 2023

作为服务端时候,http 方法被配置在配置文件中, 需要一个转换函数将 str 转换成 HttpMethod, 打印配置时候需要将HttpMethod 转换成str

    app().registerHandler(
        "/hello_user",
        [](const HttpRequestPtr &req,
           std::function<void(const HttpResponsePtr &)> &&callback) {
            callback(resp);
        },
        {to_http_method("GET")});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants