Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Last active June 9, 2022 17:38
Show Gist options
  • Save mr-pascal/fae235b3606c5d30bcbf577fc2171b1d to your computer and use it in GitHub Desktop.
Save mr-pascal/fae235b3606c5d30bcbf577fc2171b1d to your computer and use it in GitHub Desktop.
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