Last active
June 9, 2022 17:38
-
-
Save mr-pascal/fae235b3606c5d30bcbf577fc2171b1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use serde::{Deserialize, Serialize}; | |
use reqwest::header::CONTENT_TYPE; | |
#[derive(Serialize, Deserialize, Debug)] | |
struct GETAPIResponse { | |
origin: String, | |
} | |
#[derive(Serialize, Deserialize, Debug)] | |
struct JSONResponse { | |
json: HashMap<String, String>, | |
} | |
#[tokio::main] | |
async fn main() -> Result<(), Box<dyn std::error::Error>> { | |
// - Create a new client which is re-used between requests | |
let client = reqwest::Client::new(); | |
/// Business logic comes here | |
/// ... | |
/// ... | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment