#include <httpserver.h>
Definition at line 153 of file httpserver.h.
◆ State
| Enumerator |
|---|
| Init | |
| NeedsHeaders | |
| NeedsBody | |
| Complete | |
| Error | |
Definition at line 195 of file httpserver.h.
◆ HTTPRequest() [1/2]
◆ HTTPRequest() [2/2]
| HTTPRequest::HTTPRequest |
( |
| ) |
|
|
inlineexplicit |
Construct with a null client for unit tests.
Definition at line 158 of file httpserver.h.
◆ GetChunkProgress()
| uint64_t HTTPRequest::GetChunkProgress |
( |
| ) |
const |
|
inline |
◆ GetChunkSize()
| std::optional< uint64_t > HTTPRequest::GetChunkSize |
( |
| ) |
const |
|
inline |
◆ GetClient()
◆ GetHeader()
| std::optional< std::string > HTTPRequest::GetHeader |
( |
std::string_view |
hdr | ) |
const |
◆ GetPeer()
◆ GetQueryParameter()
| std::optional< std::string > HTTPRequest::GetQueryParameter |
( |
std::string_view |
key | ) |
const |
◆ GetRequestMethod()
◆ GetState()
| State HTTPRequest::GetState |
( |
| ) |
const |
|
inline |
◆ GetURI()
| std::string HTTPRequest::GetURI |
( |
| ) |
const |
|
inline |
◆ GetVersion()
◆ LoadBody()
◆ LoadControlData()
Methods that attempt to parse HTTP request fields line-by-line from a receive buffer.
- Parameters
-
| [in] | reader | A LineReader object constructed over a span of data. |
- Returns
- true If the request field was parsed. false If there was not enough data in the buffer to complete the field.
- Exceptions
-
| std::runtime_error | if data is invalid. |
Definition at line 378 of file httpserver.cpp.
◆ LoadHeaders()
◆ ReadBody()
| std::string HTTPRequest::ReadBody |
( |
| ) |
const |
|
inline |
◆ SetState()
| void HTTPRequest::SetState |
( |
State |
state | ) |
|
|
inline |
◆ WriteHeader()
| void HTTPRequest::WriteHeader |
( |
std::string && |
hdr, |
|
|
std::string && |
value |
|
) |
| |
◆ WriteReply() [1/2]
| void HTTPRequest::WriteReply |
( |
HTTPStatusCode |
status, |
|
|
std::span< const std::byte > |
reply_body = {} |
|
) |
| |
◆ WriteReply() [2/2]
| void HTTPRequest::WriteReply |
( |
HTTPStatusCode |
status, |
|
|
std::string_view |
reply_body_view |
|
) |
| |
|
inline |
◆ m_body
| std::string HTTPRequest::m_body |
|
private |
◆ m_chunk_read
| uint64_t HTTPRequest::m_chunk_read {0} |
|
private |
◆ m_chunk_size
| std::optional<uint64_t> HTTPRequest::m_chunk_size |
|
private |
◆ m_client
Pointer to the client that made the request so we know who to respond to.
Definition at line 213 of file httpserver.h.
◆ m_headers
◆ m_method
◆ m_response_headers
Response headers may be set in advance before response body is known.
Definition at line 216 of file httpserver.h.
◆ m_state
◆ m_target
| std::string HTTPRequest::m_target |
|
private |
◆ m_version
The documentation for this class was generated from the following files: