| 391 | } |
| 392 | |
| 393 | void server_http_context::post(const std::string & path, const server_http_context::handler_t & handler) const { |
| 394 | pimpl->srv->Post(path_prefix + path, [handler](const httplib::Request & req, httplib::Response & res) { |
| 395 | server_http_req_ptr request = std::make_unique<server_http_req>(server_http_req{ |
| 396 | get_params(req), |
| 397 | get_headers(req), |
| 398 | req.path, |
| 399 | req.body, |
| 400 | req.is_connection_closed |
| 401 | }); |
| 402 | server_http_res_ptr response = handler(*request); |
| 403 | process_handler_response(std::move(request), response, res); |
| 404 | }); |
| 405 | } |
| 406 | |