SOMHunter Core
sh::Http Class Reference

#include <http.h>

Public Member Functions

 ~Http () noexcept
 
void do_POST_async (const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers={}, std::function< void(ReqCode, nlohmann::json)> cb_succ={}, std::function< void()> cb_err={})
 
void do_GET_async (const std::string &URL, const nlohmann::json &query, const nlohmann::json &headers={}, std::function< void(ReqCode, nlohmann::json)> cb_succ={}, std::function< void()> cb_err={})
 
std::pair< ReqCode, std::vector< uint8_t > > do_request_sync (const RequestType request_method, const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers={})
 
std::pair< ReqCode, nlohmann::json > do_POST_sync_json (const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers={})
 
std::pair< ReqCode, nlohmann::json > do_GET_sync_json (const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers={})
 
std::pair< ReqCode, std::vector< float > > do_GET_sync_floats (const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers)
 
std::tuple< ReqCode, std::vector< float >, std::vector< int > > do_GET_sync_distances (const std::string &URL, const nlohmann::json &body, const nlohmann::json &headers)
 
void set_allow_insecure (bool val)
 
bool get_allow_insecure () const
 

Private Member Functions

void common_finish ()
 
void prune_threads ()
 

Private Attributes

std::vector< std::thread > submit_threads
 
std::vector< std::unique_ptr< bool > > finish_flags
 
bool _allow_insecure
 

Constructor & Destructor Documentation

◆ ~Http()

Http::~Http ( )
noexcept

Member Function Documentation

◆ common_finish()

void sh::Http::common_finish ( )
inlineprivate
Here is the call graph for this function:

◆ do_GET_async()

void Http::do_GET_async ( const std::string &  URL,
const nlohmann::json &  query,
const nlohmann::json &  headers = {},
std::function< void(ReqCode, nlohmann::json)>  cb_succ = {},
std::function< void()>  cb_err = {} 
)

◆ do_GET_sync_distances()

std::tuple< ReqCode, std::vector< float >, std::vector< int > > sh::Http::do_GET_sync_distances ( const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers 
)

◆ do_GET_sync_floats()

std::pair< ReqCode, std::vector< float > > sh::Http::do_GET_sync_floats ( const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers 
)

◆ do_GET_sync_json()

std::pair< ReqCode, nlohmann::json > sh::Http::do_GET_sync_json ( const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers = {} 
)

◆ do_POST_async()

void Http::do_POST_async ( const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers = {},
std::function< void(ReqCode, nlohmann::json)>  cb_succ = {},
std::function< void()>  cb_err = {} 
)

◆ do_POST_sync_json()

std::pair< ReqCode, nlohmann::json > sh::Http::do_POST_sync_json ( const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers = {} 
)

◆ do_request_sync()

std::pair< ReqCode, std::vector< uint8_t > > sh::Http::do_request_sync ( const RequestType  request_method,
const std::string &  URL,
const nlohmann::json &  body,
const nlohmann::json &  headers = {} 
)

◆ get_allow_insecure()

bool sh::Http::get_allow_insecure ( ) const
inline

◆ prune_threads()

void sh::Http::prune_threads ( )
inlineprivate

◆ set_allow_insecure()

void sh::Http::set_allow_insecure ( bool  val)
inline

Member Data Documentation

◆ _allow_insecure

bool sh::Http::_allow_insecure
private

◆ finish_flags

std::vector<std::unique_ptr<bool> > sh::Http::finish_flags
private

◆ submit_threads

std::vector<std::thread> sh::Http::submit_threads
private

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