BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
29 #include <curl/curl.h>
33 namespace graphene {
namespace utilities {
67 const std::string& url,
68 const std::string& auth,
69 const std::string& query )
const;
73 http_response post(
const std::string& url,
const std::string& auth,
const std::string& query )
const;
74 http_response put(
const std::string& url,
const std::string& auth,
const std::string& query )
const;
78 static CURL* init_curl();
79 static curl_slist* init_request_headers();
83 void operator()( CURL* p_curl )
const;
86 struct curl_slist_deleter
88 void operator()( curl_slist* slist )
const;
91 std::unique_ptr<CURL, curl_deleter> curl { init_curl() };
92 std::unique_ptr<curl_slist, curl_slist_deleter> request_headers { init_request_headers() };
98 es_client(
const std::string& p_base_url,
const std::string& p_auth ) : base_url(p_base_url), auth(p_auth) {}
104 bool send_bulk(
const std::vector<std::string>& bulk_lines )
const;
105 bool del(
const std::string& path )
const;
106 std::string
get(
const std::string& path )
const;
107 std::string
query(
const std::string& path,
const std::string&
query )
const;
112 std::string base_url;
142 const std::string& prefix,
143 uint16_t max_depth );
static fc::variant adapt(const fc::variant_object &op, uint16_t max_depth)
es_client(const std::string &p_base_url, const std::string &p_auth)
An order-perserving dictionary of variant's.
bool check_status() const
http_response request(http_request_method method, const std::string &url, const std::string &auth, const std::string &query) const
An order-perserving dictionary of variant's.
std::vector< std::string > createBulk(const fc::mutable_variant_object &bulk_header, std::string &&data)
http_response del(const std::string &url, const std::string &auth) const
bool del(const std::string &path) const
std::string get(const std::string &path) const
http_response post(const std::string &url, const std::string &auth, const std::string &query) const
void check_version_7_or_above(bool &result) const noexcept
static fc::variant adapt_map_item(const fc::variants &v, uint16_t max_depth)
std::string query(const std::string &path, const std::string &query) const
static constexpr uint16_t HTTP_200
static constexpr size_t request_size_threshold
When doing bulk operations, call send_bulk when the approximate size of pending data reaches this val...
static constexpr uint16_t HTTP_401
static constexpr uint16_t HTTP_413
std::vector< variant > variants
http_response put(const std::string &url, const std::string &auth, const std::string &query) const
std::string get_version() const
static fc::variant adapt_static_variant(const fc::variants &v, uint16_t max_depth)
http_response get(const std::string &url, const std::string &auth) const
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
static void extract_data_from_variant(const fc::variant &v, fc::mutable_variant_object &mv, const std::string &prefix, uint16_t max_depth)
Extract data from v into mv.
bool send_bulk(const std::vector< std::string > &bulk_lines) const
static void in_situ_adapt(fc::variants &v, uint16_t max_depth)
Update directly, no return.