/// Perform a HTTP GET against the given URL
Perform a HTTP GET against the given URL
Perform a HTTP GET against the given URL
async fn http_get(&self, url: &str) -> FileDownloadResult<Response<Body>> {
        let url: Uri = url
            .parse::<Uri>()
            .map_err(|e| FileDownloadError::bad_url(url, e))?;
        let response = self
            .http_client
            .get(url.clone())
            .await
            .map_err(FileDownloadError::from)?;
        if response.status().is_success() {
            Ok(response)
        } else {
            Err(FileDownloadError::HttpError(HttpError::NonSuccessResponse(
                Method::GET,
                url,
                response.status(),
            )))
        }
    }
async fn http_get ( & self , url : & str ) -> FileDownloadResult < Response < Body > > { let url : Uri = url . parse :: < Uri > ( ) . map_err ( | e | FileDownloadError :: bad_url ( url , e ) ) ? ; let response = self . http_client . get ( url . clone ( ) ) . await . map_err ( FileDownloadError :: from ) ? ; if response . status ( ) . is_success ( ) { Ok ( response ) } else { Err ( FileDownloadError :: HttpError ( HttpError :: NonSuccessResponse ( Method :: GET , url , response . status ( ) , ) ) ) } }
Perform a HTTP GET against the given URL
Perform a HTTP GET against the given URL
&self
url
&str