blob: 225562dbff45ba7d77887f21ae6246951227bbd0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use crate::{error::CliError, config::SETTINGS, default_headers};
pub fn get(id: String) -> Result<(), CliError> {
let res = reqwest::blocking::Client::new()
.get(
format!(
"{}/start",
SETTINGS.get_string("server").map_err(CliError::Config)?
)
)
.headers(default_headers()?)
.body(
format!(r#"{{"id": "{}"}}"#, id)
)
.send()
.map_err(CliError::Reqwest)?
.text();
println!("{:?}", res);
Ok(())
}
|