use reqwest::{ Method, blocking::{ Client, Response, } }; use crops_api_models::UserMe; fn main() { let bearer = ""; let acc_id = ""; if bearer.is_empty() { panic!("missing value for bearer"); } if acc_id.is_empty() { panic!("missing value for account id"); } let url = "https://api.harvestapp.com/v2/users/me"; let method = Method::from_bytes("GET".as_bytes()).unwrap(); let resp: Response = Client::new() .request(method, url) .header("Authorization", format!("Bearer {}", bearer)) .header("Harvest-Account-Id", acc_id) .header("User-Agent", "harvest-api-models rust example") .send() .unwrap(); let model: UserMe = resp.json().unwrap(); println!("json: {:?}", model) }