#include <http.hpp>
◆ MessageBase() [1/3]
dcn::http::MessageBase::MessageBase |
( |
| ) |
|
◆ MessageBase() [2/3]
dcn::http::MessageBase::MessageBase |
( |
MessageBase && |
other | ) |
|
|
default |
◆ MessageBase() [3/3]
◆ ~MessageBase()
virtual dcn::http::MessageBase::~MessageBase |
( |
| ) |
|
|
virtualdefault |
◆ addHeader()
Adds a header to the message.
If the header does not exist, it is added. Even If the header of the same key already exists.
- Parameters
-
[in] | header | The header to add. |
[in] | value | The value of the header. |
◆ getBody()
const std::string & dcn::http::MessageBase::getBody |
( |
| ) |
const |
Gets the body of the message.
- Returns
- The body of the message.
◆ getHeader()
std::vector< std::string > dcn::http::MessageBase::getHeader |
( |
Header |
header | ) |
const |
Gets the value of a header.
- Parameters
-
[in] | header | The header to get the value of. |
- Returns
- The value of the header.
◆ getHeaders()
Gets the headers of the message.
- Returns
- The headers of the message.
◆ getVersion()
const std::string & dcn::http::MessageBase::getVersion |
( |
| ) |
const |
Gets the version of the message.
- Returns
- The version of the message.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setBody()
Sets the body of the message.
This function sets the body of the message to the provided string and updates the Content-Length header to reflect the size of the new body.
- Parameters
-
[in] | body | The body content to set. |
◆ setBodyWithContentLength()
MessageBase & dcn::http::MessageBase::setBodyWithContentLength |
( |
const std::string & |
body | ) |
|
Sets the body of the message.
This function sets the body of the message to the provided string and updates the Content-Length header to reflect the size of the new body.
- Parameters
-
[in] | body | The body content to set. |
◆ setHeader()
Set a header in the message.
- Parameters
-
[in] | header | The header to set. |
[in] | value | The value of the header. |
If the header does not exist, it is added. If the header already exists, its value is replaced.
◆ setVersion()
Sets the HTTP version of the message.
- Parameters
-
[in] | version | The version to set. |
The documentation for this class was generated from the following files: