![]() |
Webdar 1.0.0
Web user interface to libdar
|
class holding fields of an HTTP request (method, URI, header, cookies, and so on) More...
#include <request.hpp>
Public Member Functions | |
request (const std::shared_ptr< central_report > &log) | |
The constructor. | |
request (const request &ref)=default | |
request (request &&ref) noexcept=default | |
request & | operator= (const request &ref)=default |
request & | operator= (request &&ref) noexcept=default |
void | clear () |
clear all fields of the request | |
bool | try_reading (proto_connexion &input) |
void | read (proto_connexion &input) |
const std::string & | get_method () const |
obtains the method of the read request | |
void | change_method (const std::string &val) |
manually change the method of the request | |
void | post_to_get () |
change POST request to a GET request, No modification for others | |
const uri & | get_uri () const |
obtains the URI of the read request | |
int | get_maj_version () const |
obtains the MAJOR version string of the read request | |
int | get_min_version () const |
obtains the MINOR version string of the read request | |
const std::string & | get_body () const |
obtain the body of the read request | |
std::map< std::string, std::string > | get_body_form () const |
void | add_cookie (const std::string &key, const std::string &value) const |
bool | find_cookie (const std::string &key, std::string &value) const |
lookup for a cookie | |
bool | find_attribute (const std::string &key, std::string &value) const |
raw request header header access | |
unsigned int | get_multipart_number () const |
analyse body as a MIME multipart component (RFC 1521) More... | |
std::map< troncon, troncon > | get_header_of_multipart (unsigned int num) const |
obtains the headers of multiparts once get_multipart_number() has been executed More... | |
troncon | get_body_of_multipart (unsigned int num) const |
obtains the body of multiparts once get_multipart_number() has been executed More... | |
void | fake_valid_request () |
set the fields in consistent state to mimic a valid request More... | |
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
void request::add_cookie | ( | const std::string & | key, |
const std::string & | value | ||
) | const |
manually add a cookie to the request (should be used exceptionally)
void request::fake_valid_request | ( | ) |
set the fields in consistent state to mimic a valid request
map< string, string > request::get_body_form | ( | ) | const |
obtain the body splitted in as list of attribute-value pair
troncon request::get_body_of_multipart | ( | unsigned int | num | ) | const |
obtains the body of multiparts once get_multipart_number() has been executed
[in] | num | the part number of the multipart in this request, first part is starting at index zero |
obtains the headers of multiparts once get_multipart_number() has been executed
[in] | num | the part number of the multipart in this request, first part is starting at index zero |
unsigned int request::get_multipart_number | ( | ) | const |
analyse body as a MIME multipart component (RFC 1521)
void request::read | ( | proto_connexion & | input | ) |
read the next request from input connexion
bool request::try_reading | ( | proto_connexion & | input | ) |
try reading just enough data in order to determine the uri of the next request