![]() |
NetFlex
0.0.0
C++11 HTTP Server Library.
|
#include <response.hpp>
Public Member Functions | |
response (void) | |
default ctor | |
~response (void)=default | |
default dtor | |
response (const response &)=default | |
copy ctor | |
response & | operator= (const response &)=default |
assignment operator | |
const std::string & | get_http_version (void) const |
unsigned int | get_status_code (void) const |
const std::string & | get_reason_phase (void) const |
void | set_http_version (const std::string &version) |
void | set_status_code (unsigned int code) |
void | set_reason_phrase (const std::string &reason) |
const header_list_t & | get_headers (void) const |
void | add_header (const header &header) |
void | set_headers (const header_list_t &headers) |
const std::string & | get_body (void) const |
void | set_body (const std::string &body) |
std::string | to_http_packet (void) const |
http response representation contains all information related to the http response to be sent
void netflex::http::response::add_header | ( | const header & | header | ) |
add a header to the headers list to be returned to the client if the header already exists, override it
header | header to be added |
const std::string& netflex::http::response::get_body | ( | void | ) | const |
const header_list_t& netflex::http::response::get_headers | ( | void | ) | const |
const std::string& netflex::http::response::get_http_version | ( | void | ) | const |
const std::string& netflex::http::response::get_reason_phase | ( | void | ) | const |
unsigned int netflex::http::response::get_status_code | ( | void | ) | const |
void netflex::http::response::set_body | ( | const std::string & | body | ) |
set response body to be returned to the client
body | new body to be returned |
void netflex::http::response::set_headers | ( | const header_list_t & | headers | ) |
set a headers list to be used for the http response
headers | headers list for http response |
void netflex::http::response::set_http_version | ( | const std::string & | version | ) |
set the http version used for the response
version | http version |
void netflex::http::response::set_reason_phrase | ( | const std::string & | reason | ) |
set reason phrase
reason | reason phrase to return to the client |
void netflex::http::response::set_status_code | ( | unsigned int | code | ) |
set response status code
code | status code to return to the client |
std::string netflex::http::response::to_http_packet | ( | void | ) | const |
convert response to http packet