gdpm/include/http.hpp
David J. Allen 2fd55de71e Install and Remove Patch
Fixed issue where packages would not install or remove correctly.
2022-01-16 23:14:47 -06:00

18 lines
No EOL
590 B
C++

#pragma once
#include "constants.hpp"
#include <unordered_map>
namespace gdpm::http{
struct response{
long code = 0;
std::string body{};
std::unordered_map<std::string, std::string> headers{};
};
response request_get(const std::string& url, size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
response request_post(const std::string& url, const char *post_fields="", size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
response download_file(const std::string& url, const std::string& storage_path, size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
}