mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Common/HTTP: Implement Multiform
This commit is contained in:

committed by
Admiral H. Curtiss

parent
5f7e9d3bf1
commit
0d908a83e7
@ -8,6 +8,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -35,6 +36,12 @@ public:
|
||||
using Response = std::optional<std::vector<u8>>;
|
||||
using Headers = std::map<std::string, std::optional<std::string>>;
|
||||
|
||||
struct Multiform
|
||||
{
|
||||
std::string name;
|
||||
std::string data;
|
||||
};
|
||||
|
||||
void SetCookies(const std::string& cookies);
|
||||
void UseIPv4();
|
||||
void FollowRedirects(long max = 1);
|
||||
@ -48,6 +55,10 @@ public:
|
||||
Response Post(const std::string& url, const std::string& payload, const Headers& headers = {},
|
||||
AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only);
|
||||
|
||||
Response PostMultiform(const std::string& url, std::span<Multiform> multiform,
|
||||
const Headers& headers = {},
|
||||
AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> m_impl;
|
||||
|
Reference in New Issue
Block a user