pub struct HttpClient { /* private fields */ }Expand description
HTTP client implementation using reqwest
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new(timeout: Duration) -> Result<Self>
pub fn new(timeout: Duration) -> Result<Self>
Create a new HTTP client with the specified timeout
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,
request_headers: &HashMap<String, String>,
) -> Result<HttpResponse>
pub async fn get_with_headers( &self, url: &str, request_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
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Freeze for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin 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