Struct reqwest_middleware::RequestBuilder
source · [−]pub struct RequestBuilder { /* private fields */ }
Expand description
This is a wrapper around reqwest::RequestBuilder
exposing the same API.
Implementations
sourceimpl RequestBuilder
impl RequestBuilder
pub fn header<K, V>(self, key: K, value: V) -> Self where
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 basic_auth<U, P>(self, username: U, password: Option<P>) -> Self where
U: Display,
P: Display,
pub fn bearer_auth<T>(self, token: T) -> Self where
T: Display,
pub fn body<T: Into<Body>>(self, body: T) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn multipart(self, multipart: Form) -> Self
pub fn query<T: Serialize + ?Sized>(self, query: &T) -> Self
pub fn form<T: Serialize + ?Sized>(self, form: &T) -> Self
pub fn json<T: Serialize + ?Sized>(self, json: &T) -> Self
pub fn build(self) -> Result<Request>
pub async fn send(self) -> Result<Response>
sourcepub async fn send_with_extensions(
self,
ext: &mut Extensions
) -> Result<Response>
pub async fn send_with_extensions(
self,
ext: &mut Extensions
) -> Result<Response>
Sends a request with initial Extensions
.
pub fn try_clone(self) -> Option<Self>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more