clrigctl/src/cloudlog.rs

22 lines
406 B
Rust
Raw Normal View History

2023-11-29 15:53:47 +01:00
use reqwest::Client;
2023-11-29 20:00:05 +01:00
use serde::Serialize;
2023-11-29 15:53:47 +01:00
#[derive(Serialize)]
pub struct RadioData {
pub key: String,
pub radio: String,
2023-11-29 20:00:05 +01:00
pub frequency: String,
2023-11-29 15:53:47 +01:00
pub mode: String,
2023-11-29 19:55:17 +01:00
pub power: String,
2023-11-29 15:53:47 +01:00
}
#[tokio::main]
pub async fn upload(url: &str, radio_data: &RadioData) {
2023-11-29 20:00:05 +01:00
let _res = Client::new()
.post(url)
.json(&radio_data)
.send()
.await
.unwrap();
2023-11-29 19:55:17 +01:00
}