pub struct HttpConnector { /* private fields */ }Expand description
HTTP Connectivity module for checking HTTP/HTTPS connections
Implementations§
Source§impl HttpConnector
impl HttpConnector
Sourcepub fn with_timeout(timeout: Duration) -> Result<Self>
pub fn with_timeout(timeout: Duration) -> Result<Self>
Create a new HTTP connector with a custom timeout
Sourcepub async fn check_url<U: AsRef<str>>(&self, url: U) -> Result<bool>
pub async fn check_url<U: AsRef<str>>(&self, url: U) -> Result<bool>
Check if a URL is reachable
Sourcepub async fn check_status<U: AsRef<str>>(
&self,
url: U,
) -> Result<Option<StatusCode>>
pub async fn check_status<U: AsRef<str>>( &self, url: U, ) -> Result<Option<StatusCode>>
Check a URL and return the status code if reachable
Sourcepub async fn get_content<U: AsRef<str>>(&self, url: U) -> Result<String>
pub async fn get_content<U: AsRef<str>>(&self, url: U) -> Result<String>
Get the content of a URL
Sourcepub async fn verify_status<U: AsRef<str>>(
&self,
url: U,
expected_status: StatusCode,
) -> Result<bool>
pub async fn verify_status<U: AsRef<str>>( &self, url: U, expected_status: StatusCode, ) -> Result<bool>
Verify that a URL responds with a specific status code
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpConnector
impl !RefUnwindSafe for HttpConnector
impl Send for HttpConnector
impl Sync for HttpConnector
impl Unpin for HttpConnector
impl !UnwindSafe for HttpConnector
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