Type Alias Body

Source
pub type Body = Body<BoxedStream>;
Available on crate feature blocking only.
Expand description

Type alias for blocking HTTP request bodies.

Aliased Type§

enum Body {
    Bytes {
        content: Cow<'static, [u8]>,
        content_type: Cow<'static, str>,
    },
    Form {
        fields: Vec<(Cow<'static, str>, Cow<'static, str>)>,
    },
    Multipart {
        parts: Vec<Part<Box<dyn BodyStream>>>,
    },
    // some variants omitted
}

Variants§

§

Bytes

Raw byte content with a specified content type.

Fields

§content: Cow<'static, [u8]>

The actual byte content of the body.

§content_type: Cow<'static, str>

The MIME content type for the body.

§

Form

URL-encoded form data.

Fields

§fields: Vec<(Cow<'static, str>, Cow<'static, str>)>

Collection of key-value pairs representing the form fields.

§

Multipart

Multipart form data, enabled with the “multipart” feature.

Fields

§parts: Vec<Part<Box<dyn BodyStream>>>

Collection of parts that make up the multipart form.