#[repr(u16)]pub enum BodyType {
Form = 1,
File = 2,
Auto = 3,
}
Expand description
The request’s body type
Variants§
Form = 1
Send request body as application/x-www-form-urlencoded
File = 2
Send request body (which is a path to a file) as application/octet-stream
Auto = 3
Detects the body type automatically
- if the body is a byte array, send is as bytes (application/octet-stream)
- if the body is an object or array, send it as JSON (application/json with UTF-8 charset)
- if the body is a string, send it as text (text/plain with UTF-8 charset)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BodyType
impl<'de> Deserialize<'de> for BodyType
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BodyType
impl RefUnwindSafe for BodyType
impl Send for BodyType
impl Sync for BodyType
impl Unpin for BodyType
impl UnwindSafe for BodyType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more