identt
HttpClient.hpp
Go to the documentation of this file.
1 
33 #ifndef _IDENTT_QUERY_HTTP_CLIENT_HPP_
34 #define _IDENTT_QUERY_HTTP_CLIENT_HPP_
35 
36 #include <utils/BaseUtils.hpp>
37 #include <utils/SharedTable.hpp>
38 #include <unordered_map>
39 #include <cpr/cpr.h>
40 
41 namespace identt {
42 namespace query {
43 
44 class HttpClient {
45 public:
46 
47  using GetParamsT=std::unordered_map<std::string,std::string>;
52  HttpClient();
53 
57  HttpClient(const HttpClient&) = delete;
58  HttpClient& operator=(const HttpClient&) = delete;
59 
63  virtual ~HttpClient ();
64 
86  bool GetDefault(::identt::utils::SharedTable::pointer stptr,
87  std::string url, cpr::Parameters myparams, std::string& returns, bool nothrow=false);
88 
110  bool PostJson(::identt::utils::SharedTable::pointer stptr,
111  std::string url, std::string& payload, std::string& returns, bool nothrow=false);
112 
113 };
114 } // namespace query
115 } // namespace identt
116 #endif // _IDENTT_QUERY_HTTP_CLIENT_HPP_
117 
bool GetDefault(::identt::utils::SharedTable::pointer stptr, std::string url, cpr::Parameters myparams, std::string &returns, bool nothrow=false)
GetDefault : send json to remote and get output.
virtual ~HttpClient()
destructor
Definition: HttpClient.cc:47
HttpClient()
constructor
Definition: HttpClient.cc:42
Definition: parameters.h:21
Definition: HttpClient.hpp:44
Definition: CryptoBase.hpp:49
bool PostJson(::identt::utils::SharedTable::pointer stptr, std::string url, std::string &payload, std::string &returns, bool nothrow=false)
PostJson : send json to remote and get output.