How can I send sequential HTTP Request using RxCpp. I need to send 1 messages and based on the response send some more requests to another API.
rxcpp::observable<>::create<HttpResponse>([&](rxcpp::subscriber<HttpResponse> out)
{
try
{
http_client->build()->Send(/*Params and Headers and ...*/)
.process_response([&](const HttpResponse& result)
{
out.on_next(result);
out.on_completed();
})
.send_request();
}
catch(...)
{
out.on_error(std::current_exception());
}
}).subscribe_on(worker_thread)
.map([&](const HttpResponse& result)
{
// Some process to create results.
});
My Question is how can I use the process result here to send other HTTP requests.
Like code above I want to create observable with another requests result and return from my function.