Function urlexpand::unshorten

source ·
pub async fn unshorten(url: &str, timeout: Option<Duration>) -> Result<String>
Expand description

UnShorten a shortened URL

§Example

 use std::time::Duration;
 use urlexpand::unshorten;

 let url = "https://bit.ly/3alqLKi";
 assert!(unshorten(url, Some(Duration::from_secs(10))).await.is_ok());   // with timeout
 assert!(unshorten(url, None).await.is_ok());    // without timeout