pub enum RequestBuilder {
Vanilla(RequestBuilder),
}
Expand description
This is a wrapper around reqwest::RequestBuilder
and [reqwest_middleware::RequestBuilder
] exposing the same API.
Variants§
Vanilla(RequestBuilder)
Implementations§
source§impl RequestBuilder
impl RequestBuilder
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere HeaderName: TryFrom<K>, <HeaderName as TryFrom<K>>::Error: Into<Error>, HeaderValue: TryFrom<V>, <HeaderValue as TryFrom<V>>::Error: Into<Error>,
pub fn headers(self, headers: HeaderMap) -> Self
pub fn version(self, version: Version) -> Self
pub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Selfwhere U: Display, P: Display,
pub fn bearer_auth<T>(self, token: T) -> Selfwhere T: Display,
pub fn body<T: Into<Body>>(self, body: T) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn query<T: Serialize + ?Sized>(self, query: &T) -> Self
pub fn form<T: Serialize + ?Sized>(self, form: &T) -> Self
pub fn build(self) -> Result<Request>
pub async fn send(self) -> Result<Response, Error>
sourcepub fn try_clone(&self) -> Option<Self>
pub fn try_clone(&self) -> Option<Self>
Attempt to clone the RequestBuilder.
None
is returned if the RequestBuilder can not be cloned,
i.e. if the request body is a stream.
Extensions
Note that extensions are not preserved through cloning.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl !UnwindSafe for RequestBuilder
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