summaryrefslogtreecommitdiff
path: root/src/discord/httpclient.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-08-11 23:37:39 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-08-11 23:37:39 -0400
commitdc28eae95a46c3079fcc76b3425ffa37844dd37d (patch)
tree046c33ad67ca66847aa92da1c6f6e580ba77af4f /src/discord/httpclient.hpp
parentbaf96da80c1e4167fb638aca8a058cc9d9cfc4fd (diff)
downloadabaddon-portaudio-dc28eae95a46c3079fcc76b3425ffa37844dd37d.tar.gz
abaddon-portaudio-dc28eae95a46c3079fcc76b3425ffa37844dd37d.zip
spoof a bunch of headers like the web client
Diffstat (limited to 'src/discord/httpclient.hpp')
-rw-r--r--src/discord/httpclient.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/discord/httpclient.hpp b/src/discord/httpclient.hpp
index 47b8a4d..841ce11 100644
--- a/src/discord/httpclient.hpp
+++ b/src/discord/httpclient.hpp
@@ -17,6 +17,8 @@ public:
void SetUserAgent(std::string agent);
void SetAuth(std::string auth);
+ void SetPersistentHeader(std::string name, std::string value);
+
void MakeDELETE(const std::string &path, const std::function<void(http::response_type r)> &cb);
void MakeGET(const std::string &path, const std::function<void(http::response_type r)> &cb);
void MakePATCH(const std::string &path, const std::string &payload, const std::function<void(http::response_type r)> &cb);
@@ -24,6 +26,8 @@ public:
void MakePUT(const std::string &path, const std::string &payload, const std::function<void(http::response_type r)> &cb);
private:
+ void AddHeaders(http::request &r);
+
void OnResponse(const http::response_type &r, const std::function<void(http::response_type r)> &cb);
void CleanupFutures();
@@ -36,4 +40,5 @@ private:
std::string m_api_base;
std::string m_authorization;
std::string m_agent;
+ std::unordered_map<std::string, std::string> m_headers;
};