Struct longport_httpcli::RequestBuilder
source · pub struct RequestBuilder<T, Q, R> { /* private fields */ }
Expand description
A request builder
Implementations§
source§impl<T, Q, R> RequestBuilder<T, Q, R>
impl<T, Q, R> RequestBuilder<T, Q, R>
sourcepub fn body<T2>(self, body: T2) -> RequestBuilder<T2, Q, R>where
T2: ToPayload,
pub fn body<T2>(self, body: T2) -> RequestBuilder<T2, Q, R>where
T2: ToPayload,
Set the request body
sourcepub fn query_params<Q2>(self, params: Q2) -> RequestBuilder<T, Q2, R>
pub fn query_params<Q2>(self, params: Q2) -> RequestBuilder<T, Q2, R>
Set the query string
sourcepub fn response<R2>(self) -> RequestBuilder<T, Q, R2>where
R2: FromPayload,
pub fn response<R2>(self) -> RequestBuilder<T, Q, R2>where
R2: FromPayload,
Set the response body type
source§impl<T, Q, R> RequestBuilder<T, Q, R>
impl<T, Q, R> RequestBuilder<T, Q, R>
sourcepub async fn send(self) -> HttpClientResult<R>
pub async fn send(self) -> HttpClientResult<R>
Send request and get the response
Auto Trait Implementations§
impl<T, Q, R> Freeze for RequestBuilder<T, Q, R>
impl<T, Q, R> !RefUnwindSafe for RequestBuilder<T, Q, R>
impl<T, Q, R> Send for RequestBuilder<T, Q, R>
impl<T, Q, R> Sync for RequestBuilder<T, Q, R>
impl<T, Q, R> Unpin for RequestBuilder<T, Q, R>
impl<T, Q, R> !UnwindSafe for RequestBuilder<T, Q, R>
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