1 2 3 4 5 6 7 8 9 10 11 12 13 14
pub mod WeatherCall { pub async fn CallApi() -> Result<(), reqwest::Error> { let res = reqwest::get("https://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=439d4b804bc8187953eb36d2a8c26a02") .await?; let body = res .text() .await?; println!("body = {:?}", body); Ok(()) } }