pub struct Request<'a> { /* private fields */ }Expand description
A mistake while building, such as an invalid header, is returned by Request::send.
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn header(self, name: &str, value: &str) -> Self
pub fn header(self, name: &str, value: &str) -> Self
Header values are never recorded in spans or logs.
pub fn bearer(self, token: &str) -> Self
pub fn json<T: Serialize + ?Sized>(self, body: &T) -> Self
Sourcepub fn form(self, fields: &[(&str, &str)]) -> Self
pub fn form(self, fields: &[(&str, &str)]) -> Self
application/x-www-form-urlencoded, as some vendors’ APIs take it.
pub fn body(self, content_type: &str, body: impl Into<Bytes>) -> Self
pub fn idempotency(self, key: &IdempotencyKey) -> Self
Sourcepub fn repeatable(self) -> Self
pub fn repeatable(self) -> Self
A POST the vendor applies once however often it arrives, such as a search, is retried
as a GET would be.
pub async fn send(self) -> Result<Response>
Auto Trait Implementations§
impl<'a> !Freeze for Request<'a>
impl<'a> !RefUnwindSafe for Request<'a>
impl<'a> !UnwindSafe for Request<'a>
impl<'a> Forget for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnsafeUnpin for Request<'a>
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