#pragma once #include #include #include namespace updater { struct HttpResult { long status = 0; std::string body; }; class Http { public: using ProgressFunc = std::function; static bool Get(const std::wstring& url, HttpResult& out, std::wstring& err); static bool Download(const std::wstring& url, const std::wstring& savePath, ProgressFunc progress, std::wstring& err); static void SetTimeoutSec(int sec) { timeoutSec_ = sec; } static int TimeoutMs() { return timeoutSec_ * 1000; } private: static int timeoutSec_; }; }