#include <Response.h>
|
enum | Mode { LENGTH,
STREAMING
} |
|
|
std::string | name |
|
std::string | tag |
|
Response
Use this object to build a response output for a protocol that uses headers and responses as the main communications protocol.
◆ Response()
core::Response::Response |
( |
| ) |
|
The constructor for the object.
◆ ~Response()
core::Response::~Response |
( |
| ) |
|
The destructor for the object.
◆ getResponse() [1/2]
std::string core::Response::getResponse |
( |
Mode |
mode | ) |
|
Returns the response generated from the contained values that do not return a content length. Using this constructor ensures a zero length Content-Length value.
- Returns
- the complete response string to send to client.
◆ getResponse() [2/2]
std::string core::Response::getResponse |
( |
std::string |
content, |
|
|
Mode |
mode |
|
) |
| |
Returns the response plus the content passed as a parameter.
This method will automatically generate the proper Content-Length value for the response.
- Parameters
-
content | the content that will be provided on the response message to the client. |
- Returns
- the complete response string to send to client.
◆ setCode()
void core::Response::setCode |
( |
std::string |
code | ) |
|
Sets the return code value for the response.
- Parameters
-
code | the response code value to return in the response. |
◆ setMimeType()
void core::Response::setMimeType |
( |
std::string |
mimeType | ) |
|
Specifies the type of data that will be returned in this response.
- Parameters
-
mimeType | the mime type for the data. |
◆ setProtocol()
void core::Response::setProtocol |
( |
std::string |
protocol | ) |
|
Sets the protocol value for the response message. The protocol should match the header received.
- Parameters
-
protocol | the protocol value to return in response. |
◆ setText()
void core::Response::setText |
( |
std::string |
text | ) |
|
Sets the return code string value for the response.
- Parameters
-
text | the text value for the response code to return on the response. |
The documentation for this class was generated from the following files:
- /home/barant/Development/BMA/server_core/ServerCore/Response.h
- /home/barant/Development/BMA/server_core/ServerCore/Response.cpp