pub struct RequestBuilder { /* private fields */ }Expand description
One outbound request being assembled.
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
pub fn header(self, name: &str, value: impl Into<String>) -> Self
pub fn bearer(self, token: &str) -> Self
pub fn body(self, body: impl Into<Vec<u8>>) -> Self
pub fn json(self, value: Json) -> Self
Sourcepub fn accept_events(self) -> Self
pub fn accept_events(self) -> Self
Ask for a server-sent event stream.
pub fn method(&self) -> Method
pub fn url(&self) -> &str
pub fn headers(&self) -> &Headers
pub fn body_bytes(&self) -> &[u8] ⓘ
Sourcepub async fn send(self) -> Result<ClientResponse>
pub async fn send(self) -> Result<ClientResponse>
Send the request and read the whole response.
Auto Trait Implementations§
impl !RefUnwindSafe for RequestBuilder
impl !UnwindSafe for RequestBuilder
impl Freeze 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