This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/client/http/PostData.h
Tamás Bálint Misius a860cbeabf
Use name-value pairs for HTTP post data and headers
And fuse them only if needed (e.g. in Libcurl.cpp). Also finally stop specifying the filename for a form item with the : separator hack.
2023-08-22 00:26:32 +02:00

24 lines
407 B
C++

#pragma once
#include "common/String.h"
#include <vector>
#include <variant>
#include <optional>
namespace http
{
struct Header
{
ByteString name;
ByteString value;
};
struct FormItem
{
ByteString name;
ByteString value;
std::optional<ByteString> filename;
};
using StringData = ByteString;
using FormData = std::vector<FormItem>;
using PostData = std::variant<StringData, FormData>;
};