Skip to main content

Module multipart

Module multipart 

Available on crate features http and multipart only.
Expand description

Server-side multipart/form-data extractor.

Built on top of the [multer] crate. Use Multipart as a handler argument to iterate over form fields. See the http_multipart example for usage.

Spec references (vendored under rama-http/specifications/):

  • RFC 7578 — multipart/form-data
  • RFC 2046 — MIME Part Two: Media Types (boundary framing)
  • RFC 6266 / RFC 8187 — Content-Disposition / charset-encoded params

Parsing leans accept-friendly: the underlying multer parser accepts the various non-ASCII filename forms surveyed by RFC 7578 §5.1.3 (raw UTF-8, RFC 2047 encoded-words, RFC 2231 / RFC 8187 ext-value), tolerates transport padding around boundaries (RFC 2046 §5.1.1), and ignores preamble and epilogue bytes.

Structs§

Field
A single field inside a Multipart stream.
InvalidMultipartBoundary
Rejection used when no boundary parameter is present in the Content-Type header (or when the header itself is missing).
InvalidMultipartContentType
Rejection used when the Content-Type is not multipart/form-data (e.g. multipart/mixed or another media type entirely).
Multipart
Extractor for multipart/form-data request bodies.
MultipartConfig
Per-field size constraints for Multipart.
MultipartError
Error type returned while reading a Multipart field.

Enums§

MultipartRejection
Rejection type for the Multipart extractor.