From 270730d9b36c8fc3a221da7e565632c1432d41c6 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:41:57 -0400 Subject: start attachments (image paste and upload) --- src/discord/httpclient.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/discord/httpclient.cpp') diff --git a/src/discord/httpclient.cpp b/src/discord/httpclient.cpp index f5b640c..6646bf3 100644 --- a/src/discord/httpclient.cpp +++ b/src/discord/httpclient.cpp @@ -112,6 +112,25 @@ void HTTPClient::MakeGET(const std::string &path, const std::function &cb) { + printf("%s %s\n", req.get_method(), req.get_url().c_str()); + m_futures.push_back(std::async(std::launch::async, [this, cb, req = std::move(req)]() mutable { + auto res = req.execute(); + OnResponse(res, cb); + })); +} + void HTTPClient::CleanupFutures() { for (auto it = m_futures.begin(); it != m_futures.end();) { if (it->wait_for(std::chrono::seconds(0)) == std::future_status::ready) -- cgit v1.2.3