Crow  1.0
A C++ microframework for the web
crow::request Struct Reference

An HTTP request. More...

Collaboration diagram for crow::request:

Public Member Functions

 request ()
 Construct an empty request. (sets the method to GET) More...
 
 request (HTTPMethod method, std::string raw_url, std::string url, query_string url_params, ci_map headers, std::string body, unsigned char http_major, unsigned char http_minor, bool has_keep_alive, bool has_close_connection, bool is_upgrade)
 Construct a request with all values assigned. More...
 
void add_header (std::string key, std::string value)
 
const std::string & get_header_value (const std::string &key) const
 
bool check_version (unsigned char major, unsigned char minor) const
 
template<typename CompletionHandler >
void post (CompletionHandler handler)
 Send data to whoever made this request with a completion handler and return immediately. More...
 
template<typename CompletionHandler >
void dispatch (CompletionHandler handler)
 Send data to whoever made this request with a completion handler. More...
 

Public Attributes

HTTPMethod method
 
std::string raw_url
 The full URL containing the ? and URL parameters. More...
 
std::string url
 The endpoint without any parameters. More...
 
query_string url_params
 The parameters associated with the request. (everything after the ?) More...
 
ci_map headers
 
std::string body
 
std::string remote_ip_address
 The IP address from which the request was sent. More...
 
unsigned char http_ver_major
 
unsigned char http_ver_minor
 
bool keep_alive
 
bool close_connection
 
bool upgrade
 
void * middleware_context {}
 
void * middleware_container {}
 
boost::asio::io_service * io_service {}
 

Detailed Description

An HTTP request.

Constructor & Destructor Documentation

◆ request() [1/2]

crow::request::request ( )
inline

Construct an empty request. (sets the method to GET)

◆ request() [2/2]

crow::request::request ( HTTPMethod  method,
std::string  raw_url,
std::string  url,
query_string  url_params,
ci_map  headers,
std::string  body,
unsigned char  http_major,
unsigned char  http_minor,
bool  has_keep_alive,
bool  has_close_connection,
bool  is_upgrade 
)
inline

Construct a request with all values assigned.

Member Function Documentation

◆ add_header()

void crow::request::add_header ( std::string  key,
std::string  value 
)
inline

◆ get_header_value()

const std::string& crow::request::get_header_value ( const std::string &  key) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_version()

bool crow::request::check_version ( unsigned char  major,
unsigned char  minor 
) const
inline
Here is the caller graph for this function:

◆ post()

template<typename CompletionHandler >
void crow::request::post ( CompletionHandler  handler)
inline

Send data to whoever made this request with a completion handler and return immediately.

◆ dispatch()

template<typename CompletionHandler >
void crow::request::dispatch ( CompletionHandler  handler)
inline

Send data to whoever made this request with a completion handler.

Member Data Documentation

◆ method

HTTPMethod crow::request::method

◆ raw_url

std::string crow::request::raw_url

The full URL containing the ? and URL parameters.

◆ url

std::string crow::request::url

The endpoint without any parameters.

◆ url_params

query_string crow::request::url_params

The parameters associated with the request. (everything after the ?)

◆ headers

ci_map crow::request::headers

◆ body

std::string crow::request::body

◆ remote_ip_address

std::string crow::request::remote_ip_address

The IP address from which the request was sent.

◆ http_ver_major

unsigned char crow::request::http_ver_major

◆ http_ver_minor

unsigned char crow::request::http_ver_minor

◆ keep_alive

bool crow::request::keep_alive

◆ close_connection

bool crow::request::close_connection

◆ upgrade

bool crow::request::upgrade

◆ middleware_context

void* crow::request::middleware_context {}

◆ middleware_container

void* crow::request::middleware_container {}

◆ io_service

boost::asio::io_service* crow::request::io_service {}

The documentation for this struct was generated from the following file: