Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
http::HttpParser Class Reference

Utility class for parsing HTTP requests and related components. More...

#include <HttpParser.hpp>

Static Public Member Functions

static std::optional< HttpRequestparse (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.
 

Detailed Description

Utility class for parsing HTTP requests and related components.

Member Function Documentation

◆ 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_requestThe 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_strThe 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: