Electroneum
Loading...
Searching...
No Matches
epee::net_utils::http Namespace Reference

Classes

struct  login
class  http_server_auth
 Implements RFC 2617 digest auth. Digests from RFC 7616 can be added. More...
class  http_client_auth
 Implements RFC 2617 digest auth. Digests from RFC 7616 can be added. More...
struct  http_header_info
struct  uri_content
struct  url_content
struct  http_request_info
struct  http_response_info
class  http_simple_client_template
struct  http_server_config
class  simple_http_connection_handler
struct  i_http_server_handler
struct  custum_handler_config
class  http_custom_handler

Typedefs

typedef std::list< std::pair< std::string, std::string > > fields_list
typedef http_simple_client_template< blocked_mode_clienthttp_simple_client

Enumerations

enum  http_method {
  http_method_options , http_method_get , http_method_post , http_method_put ,
  http_method_head , http_method_etc , http_method_unknown
}
enum  http_content_type { http_content_type_text_html , http_content_type_image_gif , http_content_type_other , http_content_type_not_set }

Functions

std::string get_value_from_fields_list (const std::string &param_name, const net_utils::http::fields_list &fields)
std::string get_value_from_uri_line (const std::string &param_name, const std::string &uri)

Typedef Documentation

◆ fields_list

typedef std::list<std::pair<std::string, std::string> > epee::net_utils::http::fields_list

Definition at line 66 of file http_base.h.

◆ http_simple_client

Enumeration Type Documentation

◆ http_content_type

Enumerator
http_content_type_text_html 
http_content_type_image_gif 
http_content_type_other 
http_content_type_not_set 

Definition at line 58 of file http_base.h.

◆ http_method

Enumerator
http_method_options 
http_method_get 
http_method_post 
http_method_put 
http_method_head 
http_method_etc 
http_method_unknown 

Definition at line 48 of file http_base.h.

Function Documentation

◆ get_value_from_fields_list()

std::string epee::net_utils::http::get_value_from_fields_list ( const std::string & param_name,
const net_utils::http::fields_list & fields )
inline

Definition at line 69 of file http_base.h.

70 {
71 fields_list::const_iterator it = fields.begin();
72 for(; it != fields.end(); it++)
73 if(!string_tools::compare_no_case(param_name, it->first))
74 break;
75
76 if(it==fields.end())
77 return std::string();
78
79 return it->second;
80 }
bool compare_no_case(const std::string &str1, const std::string &str2)
Here is the call graph for this function:

◆ get_value_from_uri_line()

std::string epee::net_utils::http::get_value_from_uri_line ( const std::string & param_name,
const std::string & uri )
inline

Definition at line 84 of file http_base.h.

85 {
86 std::string buff = "([\\?|&])";
87 buff += param_name + "=([^&]*)";
88 boost::regex match_param(buff.c_str(), boost::regex::icase | boost::regex::normal);
89 boost::smatch result;
90 if(boost::regex_search(uri, result, match_param, boost::match_default) && result[0].matched)
91 {
92 return result[2];
93 }
94 return std::string();
95 }