Changed http client to be instanciated by services

This commit is contained in:
emeric
2021-12-05 15:20:57 +01:00
parent 63ed28e38f
commit c6338771cf
14 changed files with 56 additions and 69 deletions
@@ -37,7 +37,7 @@ namespace Http
};
Priority priority {Priority::Normal};
std::string url;
std::string relativeUrl; // relative to baseUrl used by the client
using OnSuccessFunc = std::function<void(std::string_view msgBody)>;
OnSuccessFunc onSuccessFunc;
@@ -35,6 +35,6 @@ namespace Http
virtual void sendPOSTRequest(ClientPOSTRequestParameters&& request) = 0;
};
std::unique_ptr<IClient> createClient(boost::asio::io_context& ioContext);
std::unique_ptr<IClient> createClient(boost::asio::io_context& ioContext, std::string_view baseUrl);
} // namespace Http