I read the async demo, it's very easy and elegant.
void fun(Context& ctx) {
auto reply = ctx.Get("http://jsonplaceholder.typicode.com/posts/1");
auto json = reply->GetBodyAsString();
}
rest_client->Process(fun);
but, can i pass parameters into the process function like this:
void fun(Context& ctx, const std::string & url) {
auto reply = ctx.Get(url);
auto json = reply->GetBodyAsString();
}
int main() {
rest_client->Process(fun, "http://jsonplaceholder.typicode.com/posts/1");
}