fhttp_core/request/
body.rs

1use crate::path_utils::CanonicalizedPathBuf;
2
3#[derive(Debug, Eq, PartialEq, Clone)]
4pub enum Body {
5    Plain(String),
6    Multipart(Vec<MultipartPart>),
7}
8
9#[derive(Debug, Eq, PartialEq, Clone)]
10pub enum MultipartPart {
11    Text {
12        name: String,
13        text: String,
14        mime_str: Option<String>,
15    },
16    File {
17        name: String,
18        file_path: CanonicalizedPathBuf,
19        mime_str: Option<String>,
20    },
21}
22
23#[cfg(test)]
24impl Body {
25    pub fn plain<S: Into<String>>(body: S) -> Body {
26        Body::Plain(body.into())
27    }
28}