diff options
author | FxQnLr <[email protected]> | 2023-11-07 12:58:12 +0100 |
---|---|---|
committer | FxQnLr <[email protected]> | 2023-11-07 12:58:12 +0100 |
commit | 344af3ff7c9493b4e2c6eee134b9b341eaabf736 (patch) | |
tree | a6b0af984ac4e0d799ae6991635ca1980872f1ce /src/requests/device.rs | |
parent | f4d3d921460b606a9ff6686c9bb9a79bf546f264 (diff) | |
download | webol-cli-344af3ff7c9493b4e2c6eee134b9b341eaabf736.tar webol-cli-344af3ff7c9493b4e2c6eee134b9b341eaabf736.tar.gz webol-cli-344af3ff7c9493b4e2c6eee134b9b341eaabf736.zip |
add ping support and readable output
Diffstat (limited to 'src/requests/device.rs')
-rw-r--r-- | src/requests/device.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/requests/device.rs b/src/requests/device.rs index f7754a4..cbc838e 100644 --- a/src/requests/device.rs +++ b/src/requests/device.rs | |||
@@ -1,8 +1,10 @@ | |||
1 | use crate::{error::CliError, default_headers, format_url, Protocols}; | 1 | use crate::{error::CliError, default_headers, format_url, Protocols}; |
2 | 2 | ||
3 | pub async fn put(id: String, mac: String, broadcast_addr: String, ip: String) -> Result<(), CliError> { | 3 | pub async fn put(id: String, mac: String, broadcast_addr: String, ip: String) -> Result<(), CliError> { |
4 | let url = format_url("device", Protocols::Http)?; | ||
5 | println!("{}", url); | ||
4 | let res = reqwest::Client::new() | 6 | let res = reqwest::Client::new() |
5 | .put(format_url("device", Protocols::Http)?) | 7 | .put(url) |
6 | .headers(default_headers()?) | 8 | .headers(default_headers()?) |
7 | .body( | 9 | .body( |
8 | format!( | 10 | format!( |