registration put
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use bytes::Bytes;
|
||||
use getrandom::Error;
|
||||
|
||||
use crate::cryptographic_signature::{CryptographicSignature, formatPubKey, sign_message};
|
||||
use crate::message_handling::EventType;
|
||||
@@ -23,15 +24,7 @@ pub async fn register_with_the_server(
|
||||
let pubkey_bytes = encoded_point.as_ref().to_vec();
|
||||
let pubkey_bytes_minus = pubkey_bytes[1..].to_vec();
|
||||
let res = client.put(uri).body(pubkey_bytes_minus).send().await?;
|
||||
if res.status().is_success() {
|
||||
let str = hex::encode(res.bytes().await?);
|
||||
println!("Successfully registered with the server : {}", str);
|
||||
} else {
|
||||
eprintln!(
|
||||
"Failed to register with the server. Status: {}",
|
||||
res.status()
|
||||
);
|
||||
}
|
||||
let res = res.error_for_status()?;
|
||||
println!("register ip adresses");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user