Skip to content

Different URLs call different get requests #10

@Alanscut

Description

@Alanscut

Is your feature request related to a problem? Please describe.
Thank you very much for your project, it helps me a lot since I'm a green hander for C++. According to your demo, I could easily create a server which has 4 different requests, and we visit them through the same url http://localhost:34568 with different request types(GET, POST ..).

But if I want to create another GET request like http://localhost:34568/rest/api, I have no idea how to do it.

Describe the solution you'd like
if you don't mind, please add an example code in this project.

Additional context
what I want to do is that: when visit http://localhost:34568/first, then excute handle_get1, and when visit http://localhost:34568/second, then excute handle_get2.
handler.cpp

// visit it by url "http://localhost:34568/first"
void handler::handle_get1(http_request message) {
  // do some things
}

// visit it by url "http://localhost:34568/seconde"
void handler::handle_get2(http_request message) {
  // do other things
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions