pub struct Form { /* private fields */ }
Expand description
An async multipart/form-data request.
Implementations§
Source§impl Form
impl Form
Sourcepub fn text<T, U>(self, name: T, value: U) -> Form
pub fn text<T, U>(self, name: T, value: U) -> Form
Add a data field with supplied name and value.
§Examples
let form = reqwest::multipart::Form::new()
.text("username", "seanmonstar")
.text("password", "secret");
Sourcepub async fn file<T, U>(self, name: T, path: U) -> Result<Form>
Available on crate feature stream
only.
pub async fn file<T, U>(self, name: T, path: U) -> Result<Form>
stream
only.Sourcepub fn percent_encode_path_segment(self) -> Form
pub fn percent_encode_path_segment(self) -> Form
Configure this Form
to percent-encode using the path-segment
rules.
Sourcepub fn percent_encode_attr_chars(self) -> Form
pub fn percent_encode_attr_chars(self) -> Form
Configure this Form
to percent-encode using the attr-char
rules.
Sourcepub fn percent_encode_noop(self) -> Form
pub fn percent_encode_noop(self) -> Form
Configure this Form
to skip percent-encoding
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Form
impl !RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl !UnwindSafe for Form
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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