From 198c541e58dc0caf74b4a26454855dd70be45f2d Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 17 Dec 2021 10:16:38 +0100 Subject: [PATCH] proof of concept works --- src/main.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0888fad..a1b5bd5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,8 @@ +use chrono::Local; +use serde::{Deserialize, Serialize}; use std::io::prelude::*; use std::net::TcpStream; use std::str; -use chrono::{Local}; -use serde::{Deserialize, Serialize}; pub struct RigCtl { pub stream: TcpStream, @@ -63,11 +63,20 @@ fn main() { let timestamp = Local::now().format("%Y/%m/%d %H:%M").to_string(); //println!("Timestamp: {}", timestamp); - let radiodata = RadioData {key, radio, frequency, mode, timestamp}; + let radiodata = RadioData { + key, + radio, + frequency, + mode, + timestamp, + }; let radiodata_json = serde_json::to_string(&radiodata).unwrap(); let client = reqwest::blocking::Client::new(); - let resp = client.post("https://cloudlog.rustysoft.de/index.php/api/radio").body(radiodata_json).send(); + let resp = client + .post("https://cloudlog.rustysoft.de/index.php/api/radio") + .body(radiodata_json) + .send(); println!("{:?}", resp); }