pub struct RequestBuilder { /* private fields */ }Expand description
A request under construction, created by the verbs of HttpClient
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
pub fn header(self, name: &str, value: &str) -> Self
pub fn bearer(self, token: &str) -> Self
pub fn json<T: Serialize>(self, value: &T) -> Self
pub fn form<T: Serialize>(self, value: &T) -> Self
pub fn body(self, body: impl Into<Bytes>) -> Self
Sourcepub fn trace(self, incoming: &Request) -> Self
pub fn trace(self, incoming: &Request) -> Self
Continue the trace of the request being handled: sends traceparent
with the same trace id and this service’s span as the callee’s parent,
and passes tracestate on (needs TraceLayer;
does nothing without it)
pub async fn send(self) -> Result<ClientResponse, ClientError>
Auto Trait Implementations§
impl !Freeze for RequestBuilder
impl !RefUnwindSafe for RequestBuilder
impl !UnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnsafeUnpin 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