Skip to main content

Module multipart

Module multipart 

Available on crate features http and multipart only.
Expand description

Client-side multipart/form-data form builder.

Build a Form from text, byte, file, or streaming Parts and send it via RequestBuilder::multipart or by converting it directly to a Body.

Each Part carries an optional content size. When every part of a form has a known size, the form has a known content length; otherwise the body is sent with chunked transfer encoding.

Output is RFC 7578 (multipart/form-data) on top of RFC 2046 framing. Boundaries use only characters from RFC 2046 §5.1.1’s bcharsnospace set (random hex with - separators, ≤ 70 bytes). Each part is emitted with a Content-Disposition: form-data header carrying name and, where applicable, filename per RFC 7578 §4.2; non-ASCII bytes in those values are passed through as raw UTF-8. The legacy filename* ext-value form is deliberately not produced (RFC 7578 §4.2 forbids it for senders); the Content-Transfer-Encoding header is likewise omitted (§4.7).

Structs§

FieldSpec
A parsed name=… field spec for use with Form::with_field_spec.
Form
A multipart form body.
Part
A single part of a multipart Form.

Enums§

FieldSpecError
Error type returned by FieldSpec::parse.
FieldSpecSource
Source of a FieldSpec value.