#pragma once #include "common.hpp" #include "cookie.hpp" #include #include using std::string_view; using std::string; struct HttpRequest { HttpMethod method = HttpMethod::UNKNOWN; string_view path; string_view query; string_view version; string_view body; std::unordered_map headers; std::unordered_map params; // URL parameters std::vector cookies; // Parsed cookies size_t content_length = 0; bool valid = false; string_view get_cookie(string_view name) const { return CookieHelpers::get_cookie(cookies, name); } string session_id() const { return string(get_cookie("session_id")); } };