#pragma once #include "Cookie.h" #include "Http.h" #include "ParameterValue.h" #include "Session.h" #include #include namespace VWeb { struct Request { public: int ID; std::string Body; HttpMethod Method{HttpMethod::GET}; std::string URI; Ref SessionData; Ref CookieData; Cookie &GetCookie(const std::string &key) { return CookieData->Get(key); }; ParameterValue &Parameter(const std::string &key) { return Parameters[key]; } bool HasParameter(const std::string &key) const { return Parameters.contains(key); } bool HasHeader(const std::string &key) const { return Headers.contains(key); } std::string &FirstOf(const std::string &key) { return Parameters[key].GetFirst(); } ParameterValue &Header(const std::string &key) { return Headers[key]; } std::unordered_map Parameters; std::unordered_map Headers; std::unordered_map URLParameters; }; } // namespace VWeb