![]() |
NetFlex
0.0.0
C++11 HTTP Server Library.
|
#include <request.hpp>
Public Member Functions | |
request (void)=default | |
default ctor | |
~request (void)=default | |
default dtor | |
request (const request &)=default | |
copy ctor | |
request & | operator= (const request &)=default |
assignment operator | |
method | get_method (void) const |
const std::string & | get_raw_method (void) const |
const std::string & | get_target (void) const |
const std::string & | get_http_version (void) const |
void | set_method (method method) |
void | set_raw_method (const std::string &method) |
void | set_target (const std::string &target) |
void | set_http_version (const std::string &http_version) |
const std::string & | get_header (const std::string &name) const |
const header_list_t & | get_headers (void) const |
void | set_headers (const header_list_t &headers) |
void | add_header (const header &header) |
bool | has_header (const std::string &name) const |
void | remove_header (const std::string &name) |
const std::string & | get_path (void) const |
const routing::params_t & | get_params (void) const |
void | set_path (const std::string &path) |
void | set_params (const routing::params_t ¶ms) |
const std::string & | get_body (void) const |
void | set_body (const std::string &body) |
std::string | to_string (void) const |
http request representation contains all information related to the received http request
void netflex::http::request::add_header | ( | const header & | header | ) |
add a new header to the request header if header already exists, override its value
header | header to be added |
const std::string& netflex::http::request::get_body | ( | void | ) | const |
const std::string& netflex::http::request::get_header | ( | const std::string & | name | ) | const |
return specific header throws an exception if header does not exist
name | header name to get |
const header_list_t& netflex::http::request::get_headers | ( | void | ) | const |
const std::string& netflex::http::request::get_http_version | ( | void | ) | const |
method netflex::http::request::get_method | ( | void | ) | const |
const routing::params_t& netflex::http::request::get_params | ( | void | ) | const |
const std::string& netflex::http::request::get_path | ( | void | ) | const |
const std::string& netflex::http::request::get_raw_method | ( | void | ) | const |
const std::string& netflex::http::request::get_target | ( | void | ) | const |
bool netflex::http::request::has_header | ( | const std::string & | name | ) | const |
return whether the request contains a specific header
name | header name to check |
void netflex::http::request::remove_header | ( | const std::string & | name | ) |
remove a header from the request does nothing if header does not exist
name | name of the header to remove |
void netflex::http::request::set_body | ( | const std::string & | body | ) |
set request body
body | new request body |
void netflex::http::request::set_headers | ( | const header_list_t & | headers | ) |
set request headers
headers | new headers for request |
void netflex::http::request::set_http_version | ( | const std::string & | http_version | ) |
set new http version
http_version | new http version |
void netflex::http::request::set_method | ( | method | method | ) |
set new http verb
method | new http verb |
void netflex::http::request::set_params | ( | const routing::params_t & | params | ) |
set request params
params | new request params |
void netflex::http::request::set_path | ( | const std::string & | path | ) |
set requested path
path | new path for request |
void netflex::http::request::set_raw_method | ( | const std::string & | method | ) |
set new http verb (string version)
method | new http verb |
void netflex::http::request::set_target | ( | const std::string & | target | ) |
set new status line target
target | new status line target |
std::string netflex::http::request::to_string | ( | void | ) | const |