Utility class for parsing HTTP requests and related components.
More...
#include <HttpParser.hpp>
|
| static std::optional< HttpRequest > | parse (std::string_view raw_request) |
| | Parses a raw HTTP request string into a structured HttpRequest object.
|
| |
| static HttpMethod | parse_method (std::string_view method_str) |
| | Parses an HTTP method string into an HttpMethod enum value.
|
| |
Utility class for parsing HTTP requests and related components.
◆ parse()
| std::optional< HttpRequest > http::HttpParser::parse |
( |
std::string_view |
raw_request | ) |
|
|
static |
Parses a raw HTTP request string into a structured HttpRequest object.
- Parameters
-
| raw_request | The raw string view of the HTTP request. |
- Returns
- std::optional<HttpRequest> containing the parsed request, or std::nullopt if the request is malformed.
◆ parse_method()
| HttpMethod http::HttpParser::parse_method |
( |
std::string_view |
method_str | ) |
|
|
static |
Parses an HTTP method string into an HttpMethod enum value.
- Parameters
-
| method_str | The string representation of the HTTP method (e.g., "GET"). |
- Returns
- The corresponding HttpMethod enum value, or HttpMethod::UNKNOWN if not recognized.
The documentation for this class was generated from the following files: