|
|
|
@ -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<String> = 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?;
|
|
|
|
|
|
|
|
|
|
let body_text = String::from_utf8(body_bytes.to_vec())?;
|
|
|
|
|
|
|
|
|
|
println!("{:?}", res);
|
|
|
|
|
println!("{}", body_text);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|