7#include <unordered_map>
25 std::unordered_map<std::string, std::string>
query;
27 std::unordered_map<std::string_view, std::string_view, utils::CaseInsensitiveHash, utils::CaseInsensitiveEqual>
headers;
29 std::unordered_map<std::string, std::string>
params;
30 std::unordered_map<std::string, std::string>
cookies;
44 if (
body.empty())
return nlohmann::json::object();
54 auto ct =
headers.find(
"Content-Type");
55 if (ct !=
headers.end() && ct->second.starts_with(
"multipart/form-data")) {
a class to store JSON values
Definition json.hpp:19401
bool empty() const noexcept
checks whether the container is empty.
Definition json.hpp:22208
Definition Http2Session.hpp:21
HttpMethod
Represents standard HTTP methods.
Definition HttpRequest.hpp:17
Represents an incoming HTTP request.
Definition HttpRequest.hpp:22
std::string client_ip
Definition HttpRequest.hpp:31
std::unordered_map< std::string, std::string > params
Definition HttpRequest.hpp:29
nlohmann::json json() const
Parses and returns the request body as a JSON object.
Definition HttpRequest.hpp:42
std::string_view body
Definition HttpRequest.hpp:28
std::string uri
Definition HttpRequest.hpp:24
std::string session_id
Definition HttpRequest.hpp:32
MultipartForm form() const
Parses the request body as multipart/form-data.
Definition HttpRequest.hpp:53
nlohmann::json json_body
Definition HttpRequest.hpp:35
std::unordered_map< std::string, std::string > cookies
Definition HttpRequest.hpp:30
std::unordered_map< std::string, std::string > query
Definition HttpRequest.hpp:25
HttpMethod method
Definition HttpRequest.hpp:23
std::string http_version
Definition HttpRequest.hpp:26
std::unordered_map< std::string_view, std::string_view, utils::CaseInsensitiveHash, utils::CaseInsensitiveEqual > headers
Definition HttpRequest.hpp:27
nlohmann::json user
Definition HttpRequest.hpp:33