diff options
Diffstat (limited to 'include/http_request.h')
-rw-r--r-- | include/http_request.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/http_request.h b/include/http_request.h index ba1ff75..535a1fd 100644 --- a/include/http_request.h +++ b/include/http_request.h @@ -3,6 +3,7 @@ #include "common.h" #include "ci_map.h" #include "query_string.h" +#include <boost/asio.hpp> namespace crow { @@ -17,6 +18,8 @@ namespace crow return empty; } + struct DetachHelper; + struct request { HTTPMethod method; @@ -27,6 +30,7 @@ namespace crow std::string body; void* middleware_context{}; + boost::asio::io_service* io_service{}; request() : method(HTTPMethod::Get) @@ -48,5 +52,17 @@ namespace crow return crow::get_header_value(headers, key); } + template<typename CompletionHandler> + void post(CompletionHandler handler) + { + io_service->post(handler); + } + + template<typename CompletionHandler> + void dispatch(CompletionHandler handler) + { + io_service->dispatch(handler); + } + }; } |