Represents a multipart-form object to be sent in a WebRequest
.
Class MultipartForm
#include <Geode/utils/web.hpp>
classMultipartForm{ ... }
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¶m(std::string_viewname,std::string_viewvalue)
No description provided
template<integral T>geode::utils::web::MultipartForm¶m(std::string_viewname,Tvalue)
No description provided
geode::utils::web::MultipartForm&file(std::string_viewname,,std::string_viewfilename,std::string_viewmime)
No description provided
geode::Result<geode::utils::web::MultipartForm&>file(std::string_viewname,,std::string_viewmime)
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.
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.
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.
ByteVector