#include <httpserver.h>
|
| std::vector< std::pair< std::string, std::string > > | m_headers |
| | Headers can have duplicate field names, so we use a vector of key-value pairs instead of a map. More...
|
| |
| size_t | m_consumed {0} |
| | Track total bytes consumed in Read() for limit checks. More...
|
| |
Definition at line 92 of file httpserver.h.
◆ FindAll()
| std::vector< std::string_view > http_bitcoin::HTTPHeaders::FindAll |
( |
std::string_view |
key | ) |
const |
- Parameters
-
| [in] | key | The field-name of the header to search for |
- Returns
- Views into all values matching the provided key (valid while this object is alive)
Definition at line 277 of file httpserver.cpp.
◆ FindFirst()
| std::optional< std::string > http_bitcoin::HTTPHeaders::FindFirst |
( |
std::string_view |
key | ) |
const |
- Parameters
-
| [in] | key | The field-name of the header to search for |
- Returns
- The value of the first header that matches the provided key nullopt if key is not found
Definition at line 267 of file httpserver.cpp.
◆ Read()
| bool http_bitcoin::HTTPHeaders::Read |
( |
util::LineReader & |
reader, |
|
|
bool |
write = true |
|
) |
| |
- Parameters
-
| [in] | reader | A LineReader instance initialized with the client's receive buffer. |
| [in] | write | Whether or not to write the parsed data to the object after validation. |
- Returns
- false if LineReader hits the end of the buffer before reading an
, meaning that we are still waiting on more data from the client. true after reading an entire HTTP headers section, terminated by an empty line and
.
- Exceptions
-
| on | exceeded read limit and on bad headers syntax (e.g. no ":" in a line) |
Definition at line 301 of file httpserver.cpp.
◆ RemoveAll()
| void http_bitcoin::HTTPHeaders::RemoveAll |
( |
std::string_view |
key | ) |
|
- Parameters
-
| [in] | key | The field-name of the header to search for and delete |
Definition at line 293 of file httpserver.cpp.
◆ Stringify()
| std::string http_bitcoin::HTTPHeaders::Stringify |
( |
| ) |
const |
◆ Write()
| void http_bitcoin::HTTPHeaders::Write |
( |
std::string && |
key, |
|
|
std::string && |
value |
|
) |
| |
◆ m_consumed
| size_t http_bitcoin::HTTPHeaders::m_consumed {0} |
|
private |
◆ m_headers
| std::vector<std::pair<std::string, std::string> > http_bitcoin::HTTPHeaders::m_headers |
|
private |
The documentation for this class was generated from the following files: