pub struct Form { /* private fields */ }
Expand description
A multipart/form-data request.
Implementations§
source§impl Form
impl Form
sourcepub fn text<T, U>(self, name: T, value: U) -> Formwhere
T: Into<Cow<'static, str>>,
U: Into<Cow<'static, str>>,
pub fn text<T, U>(self, name: T, value: U) -> Formwhere T: Into<Cow<'static, str>>, U: Into<Cow<'static, str>>,
Add a data field with supplied name and value.
Examples
let form = reqwest::blocking::multipart::Form::new()
.text("username", "seanmonstar")
.text("password", "secret");
sourcepub fn file<T, U>(self, name: T, path: U) -> Result<Form>where
T: Into<Cow<'static, str>>,
U: AsRef<Path>,
pub fn file<T, U>(self, name: T, path: U) -> Result<Form>where T: Into<Cow<'static, str>>, U: AsRef<Path>,
sourcepub fn part<T>(self, name: T, part: Part) -> Formwhere
T: Into<Cow<'static, str>>,
pub fn part<T>(self, name: T, part: Part) -> Formwhere T: Into<Cow<'static, str>>,
Adds a customized Part.
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