34bool percent_decode(std::string_view in, std::string& out,
bool plus_as_space,
bool for_path);
46bool parse_urlencoded(std::string_view data, std::unordered_map<std::string, std::string>& out);
50void parse_cookie_header(std::string_view cookie_header, std::unordered_map<std::string, std::string>& out);
67 static std::optional<HttpRequest>
parse(std::string_view raw_request);
Utility class for parsing HTTP requests and related components.
Definition HttpParser.hpp:55
static HttpMethod parse_method(std::string_view method_str)
Parses an HTTP method string into an HttpMethod enum value.
static std::optional< HttpRequest > parse(std::string_view raw_request)
Parses one complete HTTP/1.1 request held in memory.
HttpMethod
Represents standard HTTP methods.
Definition HttpRequest.hpp:28
bool percent_decode(std::string_view in, std::string &out, bool plus_as_space, bool for_path)
Decodes XX escapes (RFC 3986 section 2.1).
bool connection_option_present(std::string_view field_value, std::string_view option)
Tests whether a Connection header field carries a given option.
void parse_cookie_header(std::string_view cookie_header, std::unordered_map< std::string, std::string > &out)
bool parse_urlencoded(std::string_view data, std::unordered_map< std::string, std::string > &out)
Decodes application/x-www-form-urlencoded data: a query string or a form body (WHATWG URL Standard se...