Public Types | Public Member Functions | Protected Member Functions | List of all members
Atom::HTTP::Client Class Reference

Public Types

using ClientResponseFunction = std::function< void(std::stringstream &response, Net::HTTPRequest &http_request, Net::HTTPResponse &http_response)>
 

Public Member Functions

 Client (std::string uri, const std::string method)
 
bool get_use_ssl () const
 
std::string get_uri () const
 
std::string get_method () const
 
std::string get_username () const
 
std::string get_password () const
 
bool get_use_credentials () const
 
std::vector< HTTP::Header > & get_headers ()
 
std::vector< HTTP::Cookie > & get_cookies ()
 
ClientResponseFunction get_response_handler () const
 
void set_use_ssl (bool use_ssl)
 
void set_uri (std::string uri)
 
void set_method (std::string method)
 
void set_username (std::string username)
 
void set_password (std::string password)
 
void set_use_credentials (bool use_credentials)
 
void set_response_handler (ClientResponseFunction response_handler)
 
void UseCredentials_ (std::string username, std::string password)
 
void SetupSSL_ (std::string key, std::string cert)
 
void SetupSSL_ (std::string rootcert)
 
void AddHeader_ (std::string name, std::string value)
 
void AddCookie_ (std::string name, std::string value)
 
void SendRequest_ ()
 

Protected Member Functions

void SendNormalRequest_ ()
 
void SendSSLRequest_ ()
 
void SetupHeaders_ (Net::HTTPRequest &http_request)
 
void SetupCookies_ (Net::HTTPRequest &http_request)