pub struct HttpClient { /* private fields */ }
Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new(timeout: u64) -> Result<HttpClient, HttpError>
pub fn get( &self, url: &str, params: Option<HashMap<&str, &str>>, headers: Option<HashMap<&str, &str>>, ) -> Result<Response, HttpError>
pub fn post<T>(
&self,
url: &str,
params: Option<HashMap<&str, &str>>,
headers: Option<HashMap<&str, &str>>,
data: Option<T>,
) -> Result<Response, HttpError>where
T: Serialize,
pub fn patch<T>(
&self,
url: &str,
params: Option<HashMap<&str, &str>>,
headers: Option<HashMap<&str, &str>>,
data: Option<T>,
) -> Result<Response, HttpError>where
T: Serialize,
pub fn delete( &self, url: &str, params: Option<HashMap<&str, &str>>, headers: Option<HashMap<&str, &str>>, ) -> Result<Response, HttpError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl !UnwindSafe for HttpClient
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