pub async fn download_page(url: &str) -> Result<String, Box<dyn Error>>Expand description
Download the content of a page from a URL
§Arguments
url- The URL of the page to download
§Exemples
use gitbook2text::download_page;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let content = download_page("https://example.com/page.md").await?;
println!("Contenu téléchargé: {} octets", content.len());
Ok(())
}§Errors
Returns an error if the HTTP request fails or if the response cannot be read