Struct longbridge_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>where
Q2: Serialize + Send + Sync + 'static,
pub fn query_params<Q2>(self, params: Q2) -> RequestBuilder<T, Q2, R>where Q2: Serialize + Send + Sync + 'static,
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>where
T: ToPayload,
Q: Serialize + Send + 'static,
R: FromPayload,
impl<T, Q, R> RequestBuilder<T, Q, R>where T: ToPayload, Q: Serialize + Send + 'static, R: FromPayload,
sourcepub async fn send(self) -> HttpClientResult<R>
pub async fn send(self) -> HttpClientResult<R>
Send request and get the response