pub struct SimpleHttpClient { /* private fields */ }Expand description
Plain reqwest-based HttpClient with no authentication.
Implementations§
Trait Implementations§
Source§impl Clone for SimpleHttpClient
impl Clone for SimpleHttpClient
Source§impl Default for SimpleHttpClient
impl Default for SimpleHttpClient
Source§impl HttpClient for SimpleHttpClient
impl HttpClient for SimpleHttpClient
Source§type Error = SimpleHttpError
type Error = SimpleHttpError
Error type returned by HTTP operations.
Source§fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<u16, SimpleHttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<u16, SimpleHttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
POST a JSON body to the given URL. Returns the HTTP status code.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(u16, Vec<u8>), SimpleHttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(u16, Vec<u8>), SimpleHttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
GET the given URL. Returns the HTTP status code and response body.
Auto Trait Implementations§
impl !RefUnwindSafe for SimpleHttpClient
impl !UnwindSafe for SimpleHttpClient
impl Freeze for SimpleHttpClient
impl Send for SimpleHttpClient
impl Sync for SimpleHttpClient
impl Unpin for SimpleHttpClient
impl UnsafeUnpin for SimpleHttpClient
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