1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
CurlRequest req;
req.url = "url";
req.progress_function = [](double file_size, double downloaded, ...)
{
if (file_size != 0)
LOG("Download progress {:.2f}%", downloaded / file_size * 100);
};
HttpWrapper::SendCurlRequest(req, [this](int code, char* data, size_t size)
{
std::ofstream out_file {"test_image_raw.jpeg", std::ios_base::binary};
if (out_file)
out_file.write(data, size);
});
|