CppCMS
Public Types | Public Member Functions | Friends
cppcms::http::request Class Reference

This class represents all information related to the HTTP/CGI request. More...

#include <cppcms/http_request.h>

Inheritance diagram for cppcms::http::request:
booster::noncopyable

List of all members.

Public Types

typedef std::multimap
< std::string, std::string > 
form_type
typedef std::map< std::string,
cookie
cookies_type
typedef std::vector
< booster::shared_ptr< file > > 
files_type

Public Member Functions

std::string auth_type ()
unsigned long long content_length ()
std::string content_type ()
cppcms::http::content_type content_type_parsed ()
std::string gateway_interface ()
std::string path_info ()
std::string path_translated ()
std::string query_string ()
std::string remote_addr ()
std::string remote_host ()
std::string remote_ident ()
std::string remote_user ()
std::string request_method ()
std::string script_name ()
std::string server_name ()
unsigned server_port ()
std::string server_protocol ()
std::string server_software ()
std::string http_accept ()
std::string http_accept_charset ()
std::string http_accept_encoding ()
std::string http_accept_language ()
std::string http_accept_ranges ()
std::string http_authorization ()
std::string http_cache_control ()
std::string http_connection ()
std::string http_cookie ()
std::string http_expect ()
std::string http_form ()
std::string http_host ()
std::string http_if_match ()
std::string http_if_none_match ()
std::pair< bool, unsigned > http_max_forwards ()
std::string http_pragma ()
std::string http_proxy_authorization ()
std::string http_range ()
std::string http_referer ()
std::string http_te ()
std::string http_upgrade ()
std::string http_user_agent ()
std::string http_via ()
std::string http_warn ()
std::string getenv (std::string const &)
std::string getenv (char const *)
char const * cgetenv (char const *)
std::map< std::string,
std::string > 
getenv ()
cookies_type const & cookies ()
cookie const & cookie_by_name (std::string const &name)
std::string get (std::string const &name)
std::string post (std::string const &name)
form_type const & get ()
form_type const & post ()
form_type const & post_or_get ()
files_type files ()
std::pair< void *, size_t > raw_post_data ()

Friends

class impl::cgi::connection

Detailed Description

This class represents all information related to the HTTP/CGI request.

It is usually accessed via http::context or application class


Member Typedef Documentation

typedef std::map<std::string,cookie> cppcms::http::request::cookies_type

Type of a map of cookie name to the cookie value

Type that represents all files uploaded in this request

typedef std::multimap<std::string,std::string> cppcms::http::request::form_type

Type that represents from-data key-value pairs


Member Function Documentation

CGI AUTH_TYPE environment variable

char const* cppcms::http::request::cgetenv ( char const *  )

Get CGI environment variable by name. Returns empty string if the variable is not set

unsigned long long cppcms::http::request::content_length ( )

CGI CONTENT_LENGTH environment variable

CGI CONTENT_TYPE environment variable

Parsed CGI CONTENT_TYPE environment variable

cookie const& cppcms::http::request::cookie_by_name ( std::string const &  name)

Get cookie by its name, if not assigned returns empty cookie

Get all cookies sent with this request

Get all uploaded files

CGI GATEWAY_INTERFACE environment variable

std::string cppcms::http::request::get ( std::string const &  name)

Fetch GET value by name, if name not exists or more then one entry with same name exists, empty string is returned

form-data GET part of request

std::string cppcms::http::request::getenv ( std::string const &  )

Get CGI environment variable by name. Returns empty string if the variable is not set

std::string cppcms::http::request::getenv ( char const *  )

Get CGI environment variable by name. Returns empty string if the variable is not set

std::map<std::string,std::string> cppcms::http::request::getenv ( )

Get map of all CGI environment variable as key-value pairs.

CGI HTTP_ACCEPT variable representing Accept HTTP header

CGI HTTP_ACCEPT_CHARSET variable representing Accept-Charset HTTP header

CGI HTTP_ACCEPT_ENCODING variable representing Accept-Encoding HTTP header

CGI HTTP_ACCEPT_LANGUAGE variable representing Accept-Language HTTP header

CGI HTTP_ACCEPT_RANGES variable representing Accept-Ranges HTTP header

CGI HTTP_AUTHORIZATION variable representing Authorization HTTP header

CGI HTTP_CACHE_CONTROL variable representing Cache-Control HTTP header

CGI HTTP_CONNECTION variable representing Connection HTTP header

CGI HTTP_COOKIE variable representing Cookie HTTP header

CGI HTTP_EXPECT variable representing Expect HTTP header

CGI HTTP_FORM variable representing Form HTTP header

CGI HTTP_HOST variable representing Host HTTP header

CGI HTTP_IF_MATCH variable representing If-Match HTTP header

CGI HTTP_IF_NONE_MATCH variable representing If-None-Match HTTP header

std::pair<bool,unsigned> cppcms::http::request::http_max_forwards ( )

GGI HTTP_MAX_FORWARDS variable representing Http-Max-Forwards

Returns a pair of {true,HTTP_MAX_FORWARDS} if set or {false,0} otherwise

CGI HTTP_PRAGMA variable representing Pragma HTTP header

CGI HTTP_PROXY_AUTHORIZATION variable representing Proxy-Authorization HTTP header

CGI HTTP_RANGE variable representing Range HTTP header

CGI HTTP_REFERER variable representing Referer HTTP header

CGI HTTP_TE variable representing Te HTTP header

CGI HTTP_UPGRADE variable representing Upgrade HTTP header

CGI HTTP_USER_AGENT variable representing User-Agent HTTP header

CGI HTTP_VIA variable representing Via HTTP header

CGI HTTP_WARN variable representing Warn HTTP header

CGI PATH_INFO environment variable

CGI PATH_TRANSLATED environment variable

std::string cppcms::http::request::post ( std::string const &  name)

Fetch POST value by name, if name not exists or more then one entry with same name exists, empty string is returned

form-data POST part of request

form-data POST or GET according to reuqest_method()

Referenced by cppcms::widgets::numeric< T >::load().

CGI QUERY_STRING environment variable

std::pair<void *,size_t> cppcms::http::request::raw_post_data ( )

Access to raw bits of POST data. If the POST request is empty or the request_type in not POST {NULL,0} will be returned.

Note: when processing multipart/form-data POST request this function will always return {NULL,0} as such requests maybe huge (file uploads of multiple hundreds of MB or even GB) that are would be stored in temporary files instead of memory. In order to get access to POST data you'll have to use post(), get(), or files() member functions.

CGI REMOTE_ADDR environment variable

CGI REMOTE_HOST environment variable

CGI REMOTE_IDENT environment variable

CGI REMOTE_USER environment variable

CGI REQUEST_METHOD environment variable

CGI SCRIPT_NAME environment variable

CGI SERVER_NAME environment variable

CGI SERVER_PORT environment variable

CGI SERVER_PROTOCOL environment variable

CGI SERVER_SOFTWARE environment variable


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