mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-20 09:11:40 +00:00
HttpRequest: Add support for sending custom headers
This commit is contained in:
parent
8f87433719
commit
ba3f16edbf
2 changed files with 34 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue