Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http method conversion function #1659

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fantasy-peak
Copy link
Contributor

No description provided.

@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.

None yet

2 participants