21#include "../IResponseFactory.h"
23#include "../CookiesList.h"
24#include "../HeadersList.h"
28namespace network_manager
44 template<typename... Args>
45 CURLcode
setOption (CURLoption option, Args... value) noexcept
47 return curl_easy_setopt (
mHandle, option, value...);
50 CURLcode
setOption (CURLoption option,
const std::string& value)
noexcept;
72 void reset () noexcept;
102 static constexpr std::chrono::milliseconds
KEEP_ALIVE_IDLE { std::chrono::seconds (120) };
Declare a RAII wrapper for the curl_slist.
CURL * getCurlHandle() const noexcept
void enableSSLValidation()
Handle(CurlHandleManager *owner, CURL *handle, RequestVerb verb, std::string url) noexcept
void disableSSLValidation()
CURLcode appendCookie(const Cookie &cookie) noexcept
CURLcode appendCookies(const CookiesList &cookie) noexcept
bool isHandleFromCache() const noexcept
unsigned getHTTPCode() const noexcept
CURLcode setOption(CURLoption option, Args... value) noexcept
void appendHeader(const Header &header)
CurlHandleManager * mOwner
void appendHeaders(const HeadersList &headers)
void cacheHandle(Handle &handle)
static constexpr std::chrono::milliseconds KEEP_ALIVE_PROBE
RequestClock::time_point RequestTimePoint
Handle getHandle(RequestVerb verb, const std::string &url)
std::vector< CachedHandle > mHandleCache
std::chrono::steady_clock RequestClock
void cleanupHandlesCache()
std::mutex mHandleCacheLock
CURL * getCurlHandleFromCache(RequestVerb verb, const std::string &url)
std::string getUserAgent() const
void setProxy(std::string proxy)
static std::string GetSchemeAndDomain(const std::string &url)
static constexpr std::chrono::milliseconds KEEP_ALIVE_IDLE
RequestTimePoint RequestTime
std::string SchemeAndDomain