| 420 | } |
| 421 | |
| 422 | void server_http_context::get(const std::string & path, const server_http_context::handler_t & handler) const { |
| 423 | pimpl->srv->Get(path_prefix + path, [handler](const httplib::Request & req, httplib::Response & res) { |
| 424 | server_http_req_ptr request = std::make_unique<server_http_req>(server_http_req{ |
| 425 | get_params(req), |
| 426 | get_headers(req), |
| 427 | req.path, |
| 428 | build_query_string(req), |
| 429 | req.body, |
| 430 | {}, |
| 431 | req.is_connection_closed |
| 432 | }); |
| 433 | server_http_res_ptr response = handler(*request); |
| 434 | process_handler_response(std::move(request), response, res); |
| 435 | }); |
| 436 | } |
| 437 | |
| 438 | void server_http_context::post(const std::string & path, const server_http_context::handler_t & handler) const { |
| 439 | pimpl->srv->Post(path_prefix + path, [handler](const httplib::Request & req, httplib::Response & res) { |