19 #ifndef NAF_HTTP_REQUEST
20 #define NAF_HTTP_REQUEST
26 #include <Poco/Net/HTTPServerRequest.h>
27 #include <Poco/Net/HTTPServerResponse.h>
28 #include <Poco/Net/HTTPCookie.h>
29 #include <Poco/Net/NameValueCollection.h>
43 using namespace Poco::Net;
50 Header(std::string name, std::string value) :
63 Cookie(std::string name, std::string value) :
76 using HTTPServerRequestPtr = std::optional<HTTPServerRequest*>;
77 using HTTPServerResponsePtr = std::optional<HTTPServerResponse*>;
81 HTTPServerRequestPtr& get_http_server_request()
83 auto& var = http_server_request_;
86 HTTPServerResponsePtr& get_http_server_response()
88 auto& var = http_server_response_;
91 std::vector<HTTP::Header> get_headers()
96 std::vector<HTTP::Cookie> get_cookies()
102 void AddHeader_(std::string name, std::string value);
103 void AddCookie_(std::string name, std::string value);
106 void SetupRequest_(Net::HTTPServerRequest& request);
107 void SetupResponse_(Net::HTTPServerResponse& response);
108 void SetupHeaders_();
109 void SetupCookies_();
112 HTTPServerRequestPtr http_server_request_;
113 HTTPServerResponsePtr http_server_response_;
114 std::vector<HTTP::Header> headers_;
115 std::vector<HTTP::Cookie> cookies_;