Struct reqwest::Body [] [src]

pub struct Body { /* fields omitted */ }

Body type for a request.

Methods

impl Body
[src]

[src]

Instantiate a Body from a reader.

Note

While allowing for many types to be used, these bodies do not have a way to reset to the beginning and be reused. This means that when encountering a 307 or 308 status code, instead of repeating the request at the new location, the Response will be returned with the redirect status code set.

A Body constructed from a set of bytes, like String or Vec<u8>, are stored differently and can be reused.

[src]

Create a Body from a Reader where we can predict the size in advance, but where we don't want to load the data in memory. This is useful if we need to ensure Content-Length is passed with the request.

Trait Implementations

impl Debug for Body
[src]

[src]

Formats the value using the given formatter. Read more

impl From<Vec<u8>> for Body
[src]

[src]

Performs the conversion.

impl From<String> for Body
[src]

[src]

Performs the conversion.

impl<'a> From<&'a [u8]> for Body
[src]

[src]

Performs the conversion.

impl<'a> From<&'a str> for Body
[src]

[src]

Performs the conversion.

impl From<File> for Body
[src]

[src]

Performs the conversion.