pub struct HttpClientManager { /* private fields */ }Expand description
HTTP client manager using reqwest
Implementations§
Source§impl HttpClientManager
impl HttpClientManager
Sourcepub fn new(config: Arc<TurboCdnConfig>) -> Result<Self>
pub fn new(config: Arc<TurboCdnConfig>) -> Result<Self>
Create a new HTTP client manager
Sourcepub async fn get(&self, url: &str) -> Result<HttpResponse>
pub async fn get(&self, url: &str) -> Result<HttpResponse>
Perform a GET request
Sourcepub async fn get_with_headers(
&self,
url: &str,
headers: &HashMap<String, String>,
) -> Result<HttpResponse>
pub async fn get_with_headers( &self, url: &str, headers: &HashMap<String, String>, ) -> Result<HttpResponse>
Perform a GET request with custom headers
Sourcepub async fn head(&self, url: &str) -> Result<HttpResponse>
pub async fn head(&self, url: &str) -> Result<HttpResponse>
Perform a HEAD request
Sourcepub fn get_metrics(&self) -> Option<ClientMetrics>
pub fn get_metrics(&self) -> Option<ClientMetrics>
Get current metrics
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HttpClientManager
impl !UnwindSafe for HttpClientManager
impl Freeze for HttpClientManager
impl Send for HttpClientManager
impl Sync for HttpClientManager
impl Unpin for HttpClientManager
impl UnsafeUnpin for HttpClientManager
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