Skip to main content

multipart_body

Function multipart_body 

Source
pub fn multipart_body(
    boundary: &str,
    parts: &[(&str, Option<&str>, &str)],
) -> String
Expand description

Builds a multipart body, one part per entry: None is a text part, Some("") the browser’s “no file chosen” part, Some(name) a chosen file.

No part carries a Content-Type: the panel tells file parts from text parts by the filename parameter alone. A test asserting on an upload’s content type builds its own body.