mirror of
https://github.com/davidallendj/gdpm.git
synced 2025-12-20 03:27:02 -07:00
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:
commit
1893c7c36b
26 changed files with 2839 additions and 0 deletions
18
include/http.hpp
Normal file
18
include/http.hpp
Normal 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);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue