aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/http_util/http_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/http_util/http_util.h')
-rw-r--r--src/utils/http_util/http_util.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/utils/http_util/http_util.h b/src/utils/http_util/http_util.h
index 0d9ab2756..d024add4d 100644
--- a/src/utils/http_util/http_util.h
+++ b/src/utils/http_util/http_util.h
@@ -51,6 +51,26 @@ struct Response
std::map<std::string, std::string> m_headers;
};
+BOTAN_DLL std::ostream& operator<<(std::ostream& o, const Response& resp);
+
+typedef std::function<std::string (const std::string&, const std::string&)> http_exch_fn;
+
+#if defined(BOTAN_HAS_BOOST_ASIO)
+std::string BOTAN_DLL http_transact_asio(const std::string& hostname,
+ const std::string& message);
+#endif
+
+std::string BOTAN_DLL http_transact_fail(const std::string& hostname,
+ const std::string& message);
+
+
+BOTAN_DLL Response http_sync(http_exch_fn fn,
+ const std::string& verb,
+ const std::string& url,
+ const std::string& content_type,
+ const std::vector<byte>& body,
+ size_t allowable_redirects);
+
BOTAN_DLL Response http_sync(const std::string& verb,
const std::string& url,
const std::string& content_type,
@@ -65,7 +85,7 @@ BOTAN_DLL Response POST_sync(const std::string& url,
const std::vector<byte>& body,
size_t allowable_redirects = 1);
-BOTAN_DLL std::future<Response> BOTAN_DLL GET_async(const std::string& url,
+std::future<Response> BOTAN_DLL GET_async(const std::string& url,
size_t allowable_redirects = 1);
BOTAN_DLL std::string url_encode(const std::string& url);