pub struct Request { /* private fields */ }Implementations§
Source§impl Request
impl Request
pub fn new(method: Method, url: impl Into<String>) -> Self
pub fn get(url: impl Into<String>) -> Self
pub fn post(url: impl Into<String>) -> Self
pub fn put(url: impl Into<String>) -> Self
pub fn delete(url: impl Into<String>) -> Self
pub fn patch(url: impl Into<String>) -> Self
pub fn head(url: impl Into<String>) -> Self
pub fn options(url: impl Into<String>) -> Self
pub fn header(self, key: impl AsRef<str>, value: impl AsRef<str>) -> Self
pub fn headers(self, headers: Vec<(impl AsRef<str>, impl AsRef<str>)>) -> Self
pub fn json<T: Serialize>(self, body: &T) -> Result<Self>
pub fn body(self, body: impl Into<Vec<u8>>) -> Self
pub fn text(self, text: impl Into<String>) -> Self
pub fn query(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn timeout(self, duration: Duration) -> Self
pub fn no_timeout(self) -> Self
pub fn follow_redirects(self, follow: bool) -> Self
pub fn send(self) -> Result<Response>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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