use bytes::Bytes; pub async fn get_peer_list(server_address: String) -> Result { let client = reqwest::Client::new(); let uri = format!("{}/peers/", server_address); let res = client.get(uri).send().await?; if res.status().is_success() { println!("Successfully retreived the addresses."); } else { eprintln!( "Failed to get the peers addresses from the server. Status: {}", res.status() ); } let body: Bytes = res.bytes().await?; Ok(body) }