Code Snippets

// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }
//              tokio   = { version = "1", features = ["full"] }
use reqwest::Error;

#[tokio::main]
async fn main() -> Result<(), Error> {
    let body = reqwest::get("https://api.github.com/zen")
        .await?
        .text()
        .await?;
    println!("{body}");
    Ok(())
}