gdpm/include/http.hpp
David J. Allen 1893c7c36b Initial commit
First commit with most of the main features implemented. May still need
some bug fixes here and there.
2021-12-30 12:56:37 -06:00

18 lines
No EOL
539 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);
response request_post(const std::string& url, const char *post_fields="", size_t timeout = GDPM_CONFIG_TIMEOUT_MS);
response download_file(const std::string& url, const std::string& storage_path, size_t timeout = GDPM_CONFIG_TIMEOUT_MS);
}