diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-06-13 12:52:10 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-06-13 12:52:31 +0200 |
| commit | ba3f16edbfe8b152f12a66b8fb3da215c8e52a1c (patch) | |
| tree | 688ef30d656e56ff630f387830d5a47eec91ffdb /Source/Core/Common/HttpRequest.h | |
| parent | 8f87433719c58c60df4cb514e9e0eb215fb65158 (diff) | |
HttpRequest: Add support for sending custom headers
Diffstat (limited to 'Source/Core/Common/HttpRequest.h')
| -rw-r--r-- | Source/Core/Common/HttpRequest.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/Common/HttpRequest.h b/Source/Core/Common/HttpRequest.h index e4e35d1cbf..0a1a86da82 100644 --- a/Source/Core/Common/HttpRequest.h +++ b/Source/Core/Common/HttpRequest.h @@ -4,6 +4,7 @@ #pragma once +#include <map> #include <memory> #include <optional> #include <string> @@ -21,9 +22,11 @@ public: bool IsValid() const; using Response = std::optional<std::vector<u8>>; - Response Get(const std::string& url); - Response Post(const std::string& url, const std::vector<u8>& payload); - Response Post(const std::string& url, const std::string& payload); + using Headers = std::map<std::string, std::optional<std::string>>; + Response Get(const std::string& url, const Headers& headers = {}); + Response Post(const std::string& url, const std::vector<u8>& payload, + const Headers& headers = {}); + Response Post(const std::string& url, const std::string& payload, const Headers& headers = {}); private: class Impl; |
