pub enum Body<S> {
Bytes {
content: Cow<'static, [u8]>,
content_type: Cow<'static, str>,
},
Form {
fields: Vec<(Cow<'static, str>, Cow<'static, str>)>,
},
Multipart {
parts: Vec<Part<S>>,
},
Stream {
stream: S,
content_type: Cow<'static, str>,
},
}Expand description
Represents different types of HTTP request bodies.
This enum encapsulates the various body formats that can be sent in an HTTP request, including raw bytes, form data, and multipart forms.
Variants§
Bytes
Raw byte content with a specified content type.
Fields
Form
URL-encoded form data.
Fields
Multipart
Available on crate feature
multipart only.Multipart form data, enabled with the “multipart” feature.
Stream
Streaming body data.