pub struct Client { /* private fields */ }
Expand description
A Http client base on curl.
Implementations§
Source§impl Client
impl Client
Sourcepub fn set_user_agent(&mut self, user_agent: &str)
pub fn set_user_agent(&mut self, user_agent: &str)
Set the User-Agent header. Default is curl-http
Sourcepub fn request(&self, method: Method, endpoint: &str) -> Result<Request<'_>>
pub fn request(&self, method: Method, endpoint: &str) -> Result<Request<'_>>
Make a specific method request.
Sourcepub fn post<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
pub fn post<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
High level HTTP POST method
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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