pub struct ReqwestHttpClient { /* private fields */ }Available on non-WebAssembly and crate feature
http-reqwest only.Expand description
Reqwest-based HTTP client for server environments
Implementations§
Source§impl ReqwestHttpClient
impl ReqwestHttpClient
Sourcepub fn new() -> Result<Self, HttpClientError>
pub fn new() -> Result<Self, HttpClientError>
Create a new HTTP client with default settings
Sourcepub fn with_timeout(timeout_secs: u64) -> Result<Self, HttpClientError>
pub fn with_timeout(timeout_secs: u64) -> Result<Self, HttpClientError>
Create a new HTTP client with custom timeout
Trait Implementations§
Source§impl Clone for ReqwestHttpClient
impl Clone for ReqwestHttpClient
Source§fn clone(&self) -> ReqwestHttpClient
fn clone(&self) -> ReqwestHttpClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ReqwestHttpClient
impl Default for ReqwestHttpClient
Source§impl HttpClient for ReqwestHttpClient
impl HttpClient for ReqwestHttpClient
Source§fn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a GET request and return JSON value
Source§fn post_form_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(String, String)],
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn post_form_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(String, String)],
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a POST request with form data and return JSON value
Source§fn post_json_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 Value,
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn post_json_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 Value,
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a POST request with JSON body and return JSON value
Auto Trait Implementations§
impl Freeze for ReqwestHttpClient
impl !RefUnwindSafe for ReqwestHttpClient
impl Send for ReqwestHttpClient
impl Sync for ReqwestHttpClient
impl Unpin for ReqwestHttpClient
impl !UnwindSafe for ReqwestHttpClient
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