|
Webserv
|
Holds the parsed components of an HTTP request's first line. More...
#include <Request.hpp>
Public Types | |
| enum | Method { GET , HEAD , POST , PUT , DELETE , UNKNOWN } |
Public Member Functions | |
| RequestStartLine () | |
Static Public Member Functions | |
| static RequestStartLine | parse (std::string const &line) |
| Parses a raw request line (e.g., "GET /path?q HTTP/1.1"). | |
| static Method | matchHttpMethod (std::string const &s) |
| Converts a method string (e.g., "GET") to its enum. | |
| static char const * | methodToString (Method m) |
| Converts a method enum to its string representation. | |
Public Attributes | |
| Method | method |
| std::string | uri |
| The full, original request-target (e.g., "/path?query=1") | |
| std::string | path |
| The path portion only (e.g., "/path") | |
| std::string | queryString |
| The query string only (e.g., "query=1") | |
| std::string | version |
| The HTTP protocol version (e.g., "HTTP/1.1") | |
Holds the parsed components of an HTTP request's first line.
| http::RequestStartLine::RequestStartLine | ( | ) |
|
static |
Converts a method string (e.g., "GET") to its enum.
|
static |
Converts a method enum to its string representation.
|
static |
Parses a raw request line (e.g., "GET /path?q HTTP/1.1").
| line | The raw string to parse. |
| Method http::RequestStartLine::method |
| std::string http::RequestStartLine::path |
The path portion only (e.g., "/path")
| std::string http::RequestStartLine::queryString |
The query string only (e.g., "query=1")
| std::string http::RequestStartLine::uri |
The full, original request-target (e.g., "/path?query=1")
| std::string http::RequestStartLine::version |
The HTTP protocol version (e.g., "HTTP/1.1")