Struct simplerusthttpsclient::HttpClient
source · pub struct HttpClient { /* private fields */ }Implementations§
source§impl HttpClient
impl HttpClient
pub fn new( base_url: Url, tls_config: Option<TlsConfig<'static>>, default_headers: Option<HeaderMap> ) -> Self
pub async fn get<T: DeserializeOwned>( &self, endpoint: &str, extra_headers: Option<HeaderMap> ) -> Result<T>
pub async fn post<T: DeserializeOwned, U: Serialize>( &self, endpoint: &str, body: &U, extra_headers: Option<HeaderMap> ) -> Result<T>
pub async fn post_file_buffer<T: DeserializeOwned, U: Serialize>( &self, url: Url, name: String, bytes: &'static [u8], multipart_file_name: Option<String>, extra_headers: Option<HeaderMap> ) -> Result<T>
pub async fn send_multipart_form<T: DeserializeOwned>( &self, url: Url, multipart_form: Form, extra_headers: Option<HeaderMap> ) -> Result<T>
pub async fn get_file( &self, url: &str, extra_headers: Option<HeaderMap> ) -> Result<Bytes>
Auto Trait Implementations§
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