mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2025-04-19 04:22:54 +00:00
21 lines
416 B
C++
21 lines
416 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
#include <future>
|
|
|
|
#include <curl/curl.h>
|
|
|
|
namespace utils::http
|
|
{
|
|
struct result
|
|
{
|
|
CURLcode code;
|
|
std::string buffer;
|
|
};
|
|
|
|
using headers = std::unordered_map<std::string, std::string>;
|
|
|
|
std::optional<result> get_data(const std::string& url, const std::string& fields = {},
|
|
const headers& headers = {}, const std::function<void(size_t)>& callback = {});
|
|
} |