HttpRes is the encapsulation class of http response, which provides methods for setting body, head, code, etc. It is not allowed to be created externally.
More...
#include <EVHttpServer.h>
HttpRes is the encapsulation class of http response, which provides methods for setting body, head, code, etc. It is not allowed to be created externally.
◆ addHeader()
bool EVHttpServer::HttpRes::addHeader |
( |
const HttpKeyVal & |
header | ) |
|
Add http reply header (single)
- Parameters
-
[in] | header | : A header to reply to the http client |
- Return values
-
true | : set success |
false | : set failed |
◆ addHeaders()
bool EVHttpServer::HttpRes::addHeaders |
( |
const std::list< HttpKeyVal > & |
list | ) |
|
Add the headers of the http reply. Unlike setHeaders, this function will not clear the previously set headers.
- Parameters
-
- Return values
-
true | : set success |
false | : set failed |
◆ setBody()
bool EVHttpServer::HttpRes::setBody |
( |
const std::string & |
body | ) |
|
set http response body
- Parameters
-
- Return values
-
true | : set success |
false | : set failed |
◆ setCode()
void EVHttpServer::HttpRes::setCode |
( |
const int & |
code | ) |
|
Set the HTTP response code to send.
- Parameters
-
[in] | code | : the HTTP response code to send |
- Returns
- void
◆ setHeaders()
bool EVHttpServer::HttpRes::setHeaders |
( |
const std::list< HttpKeyVal > & |
list | ) |
|
set http response headers
- Parameters
-
- Return values
-
true | : set success |
false | : set failed |
◆ setReason()
void EVHttpServer::HttpRes::setReason |
( |
const std::string & |
reason | ) |
|
Set reason which is a brief message to send with the response code.
- Parameters
-
[in] | reason | : a brief message to send with the response code |
- Returns
- void
The documentation for this class was generated from the following files: