mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
20 lines
606 B
C
20 lines
606 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <future>
|
||
|
|
#include <winrt/Windows.Web.Http.h>
|
||
|
|
|
||
|
|
namespace http
|
||
|
|
{
|
||
|
|
class HttpClient
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
HttpClient();
|
||
|
|
std::future<std::wstring> request(const winrt::Windows::Foundation::Uri& url);
|
||
|
|
std::future<void> download(const winrt::Windows::Foundation::Uri& url, const std::wstring& dstFle);
|
||
|
|
std::future<void> download(const winrt::Windows::Foundation::Uri& url, const std::wstring& dstFle, const std::function<void(float)>& progressUpdateCallback);
|
||
|
|
|
||
|
|
private:
|
||
|
|
winrt::Windows::Web::Http::HttpClient m_client;
|
||
|
|
};
|
||
|
|
}
|