proof of concept works
This commit is contained in:
parent
41b33f5cba
commit
198c541e58
1 changed files with 13 additions and 4 deletions
17
src/main.rs
17
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue