Skip to main content

fetch_content

Function fetch_content 

Source
pub async fn fetch_content(
    name: &str,
    url: &str,
    headers: Option<HeaderMap>,
    show_progress: bool,
) -> Result<Vec<u8>>
Expand description

Issues a GET to url (with optional headers) and returns the full response body.

If show_progress is set, renders an indicatif progress bar (labeled name) as the body streams in; otherwise the body is read in one shot.