{ \
std::string("/v1/login/" #call_name), [this](string, string body, url_response_callback cb) mutable { \
try { \
if (body.empty()) \
body = "{}"; \
cb(http_response_code, std::move(result)); \
} catch (...) { \
http_plugin::handle_exception("login", #call_name, body, cb); \
} \
} \
}
static variant from_string(const string &utf8_str, const parse_type ptype=parse_type::legacy_parser, uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
61#define CALL(call_name, http_response_code) \
62 { \
63 std::string("/v1/login/" #call_name), [this](string, string body, url_response_callback cb) mutable { \
64 try { \
65 if (body.empty()) \
66 body = "{}"; \
67 fc::variant result( call_name(fc::json::from_string(body).as<login_plugin::call_name##_params>()) ); \
68 cb(http_response_code, std::move(result)); \
69 } catch (...) { \
70 http_plugin::handle_exception("login", #call_name, body, cb); \
71 } \
72 } \
73 }