Initial commit

First commit with most of the main features implemented. May still need
some bug fixes here and there.
This commit is contained in:
David Allen 2021-12-30 12:56:37 -06:00
commit 1893c7c36b
26 changed files with 2839 additions and 0 deletions

18
include/http.hpp Normal file
View file

@ -0,0 +1,18 @@
#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);
}