diff --git a/src/main.rs b/src/main.rs index 695f1ef..e40f21f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,10 @@ use std::env::args; use anyhow::anyhow; -use hyper::{Request, Uri}; use hyper::Body; +use hyper::{Request, Uri}; use tokio::net::TcpStream; - #[tokio::main] async fn main() -> anyhow::Result<()> { let arguments: Vec = args().collect(); @@ -34,9 +33,13 @@ async fn main() -> anyhow::Result<()> { .header(hyper::header::HOST, authority.as_str()) .body(Body::from(""))?; - let mut res = sender.send_request(req).await?; + let res = sender.send_request(req).await?; + let body = res.into_body(); + let body_bytes = hyper::body::to_bytes(body).await?; - println!("{:?}", res); + let body_text = String::from_utf8(body_bytes.to_vec())?; + + println!("{}", body_text); Ok(()) }