Skip to content

Commit

Permalink
Reto #10 - Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoatrs committed Jul 29, 2023
1 parent f285d1a commit b9495c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Retos/Reto #10 - LA API [Media]/rust/marcoatrs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = "https://dog.ceo/api/breeds/image/random";

// Realizar la solicitud GET
let response = reqwest::get(url)
.await?
.json::<HashMap<String, String>>()
.await?;

println!("{:#?}", response);

Ok(())
}

0 comments on commit b9495c5

Please sign in to comment.