MultipartFormBuilder
struct MultipartFormBuilderAccumulates multipart/form-data parts; finish() yields the body.
Implements Movable
__init__
def __init__(out self) Start a builder with a unique random boundary.
def __init__(out self, boundary: String) Start a builder with a caller-fixed boundary (deterministic for tests). The caller must ensure it does not occur in any part's payload.
field
def field(mut self, name: String, value: String) Add a plain text form field.
file
def file(mut self, name: String, filename: String, content_type: String, var data: List[UInt8]) Add a file part (content_type empty defaults to application/octet-stream).
content_type
def content_type(self) -> String The Content-Type header value carrying the boundary. Read this before calling :meth:finish (which consumes).
finish
def finish(mut self) -> List[UInt8] Append the closing delimiter and return the body bytes. Leaves the builder empty (do not reuse after).