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

An HTTP request. More...

#include <http_request.h>

Public Member Functions

 request ()
 Construct an empty request. (sets the method to GET)
 
 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.
 
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
 
const query_string get_body_params ()
 Get the body as parameters in QS format. More...
 
template<typename CompletionHandler >
void post (CompletionHandler handler)
 Send data to whoever made this request with a completion handler and return immediately.
 
template<typename CompletionHandler >
void dispatch (CompletionHandler handler)
 Send data to whoever made this request with a completion handler.
 

Public Attributes

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

Detailed Description

An HTTP request.

Member Function Documentation

◆ get_body_params()

const query_string crow::request::get_body_params ( )
inline

Get the body as parameters in QS format.

This is meant to be used with requests of type "application/x-www-form-urlencoded"


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