3 #include "system/angband.h"
9 #if !defined(DISABLE_NET)
19 size_t total; ///< 通信の総バイト数。0の場合は不明
20 size_t now; ///< 通信済みのバイト数
23 class HttpContentBase;
27 * @brief HTTP GET通信のコールバック関数の型
28 * @param progress 進捗状況。libcurlの仕様によりnow/totalが0で呼ばれることがあるのでそれを考慮すること
29 * @return 通信を継続する場合はtrue、中断する場合はfalseを返す
31 using GetRequestProgressHandler = std::function<bool(Progress)>;
33 std::optional<Response> get(const std::string &url, GetRequestProgressHandler progress_handler = {});
34 std::optional<Response> get(const std::string &url, const std::filesystem::path &path, GetRequestProgressHandler progress_handler = {});
35 std::optional<Response> post(const std::string &url, const std::string &post_data, const std::string &media_type);
37 std::optional<std::string> user_agent;