Class MultipartForm

#include <Geode/utils/web.hpp>
classMultipartForm{ ... }

Represents a multipart-form object to be sent in a WebRequest.

Examples1
web::MultipartForm form;
form.param("key", "value");
form.param("key2", "value2");
form.file("file", { 0xAA, 0xBB, 0xCC }, "raw.bin");
form.file("file2", "path/to/image.png", "screenshot.png", "image/png");

auto req = web::WebRequest()
    .bodyMultipart(form)
    .get(url);
Public static methods0
Public member functions7
geode::utils::web::MultipartForm&param(,)
No description provided
template<integral T>geode::utils::web::MultipartForm&param(,
Tvalue
)
No description provided
geode::utils::web::MultipartForm&file(,,,)
No description provided
geode::Result<geode::utils::web::MultipartForm&>file(,,)
No description provided
std::stringconst&getBoundary()const

Returns the unique boundary string used in the multipart form. This will also finalize the form, so adding more parameters will not work.

Return value
std::string const&
std::stringgetHeader()const

Returns the value for the Content-Type header with unique boundary string. This will also finalize the form, so adding more parameters will not work.

Return value
std::string
geode::ByteVectorgetBody()const

Returns merged body of all parameters and files, with the correct boundary. This will also finalize the form, so adding more parameters will not work.

Return value
ByteVector
Fields0
Protected member functions0
Protected fields0