Public Member Functions | Public Attributes | List of all members
async_web_server_cpp::HttpRequest Struct Reference

#include <http_request.hpp>

Public Member Functions

std::string get_header_value_or_default (const std::string &name, const std::string &default_value) const
 
std::string get_query_param_value_or_default (const std::string &name, const std::string &default_value) const
 
template<typename T >
get_query_param_value_or_default (const std::string &name, const T &default_value) const
 
bool has_header (const std::string &name) const
 
bool has_query_param (const std::string &name) const
 
bool parse_uri ()
 

Public Attributes

std::vector< HttpHeaderheaders
 
int http_version_major
 
int http_version_minor
 
std::string method
 
std::string path
 
std::string query
 
std::map< std::string, std::string > query_params
 
std::string uri
 

Detailed Description

Represents a request from a browser

Definition at line 18 of file http_request.hpp.

Member Function Documentation

◆ get_header_value_or_default()

std::string async_web_server_cpp::HttpRequest::get_header_value_or_default ( const std::string &  name,
const std::string &  default_value 
) const

Definition at line 62 of file http_request.cpp.

◆ get_query_param_value_or_default() [1/2]

std::string async_web_server_cpp::HttpRequest::get_query_param_value_or_default ( const std::string &  name,
const std::string &  default_value 
) const

Definition at line 82 of file http_request.cpp.

◆ get_query_param_value_or_default() [2/2]

template<typename T >
T async_web_server_cpp::HttpRequest::get_query_param_value_or_default ( const std::string &  name,
const T &  default_value 
) const
inline

Definition at line 43 of file http_request.hpp.

◆ has_header()

bool async_web_server_cpp::HttpRequest::has_header ( const std::string &  name) const

Definition at line 50 of file http_request.cpp.

◆ has_query_param()

bool async_web_server_cpp::HttpRequest::has_query_param ( const std::string &  name) const

Definition at line 75 of file http_request.cpp.

◆ parse_uri()

bool async_web_server_cpp::HttpRequest::parse_uri ( )

Definition at line 12 of file http_request.cpp.

Member Data Documentation

◆ headers

std::vector<HttpHeader> async_web_server_cpp::HttpRequest::headers

Definition at line 24 of file http_request.hpp.

◆ http_version_major

int async_web_server_cpp::HttpRequest::http_version_major

Definition at line 22 of file http_request.hpp.

◆ http_version_minor

int async_web_server_cpp::HttpRequest::http_version_minor

Definition at line 23 of file http_request.hpp.

◆ method

std::string async_web_server_cpp::HttpRequest::method

Definition at line 20 of file http_request.hpp.

◆ path

std::string async_web_server_cpp::HttpRequest::path

Definition at line 26 of file http_request.hpp.

◆ query

std::string async_web_server_cpp::HttpRequest::query

Definition at line 27 of file http_request.hpp.

◆ query_params

std::map<std::string, std::string> async_web_server_cpp::HttpRequest::query_params

Definition at line 28 of file http_request.hpp.

◆ uri

std::string async_web_server_cpp::HttpRequest::uri

Definition at line 21 of file http_request.hpp.


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


async_web_server_cpp
Author(s): Mitchell Wills , Russel Toris
autogenerated on Tue Mar 1 2022 23:49:07