diff --git a/src/main.rs b/src/main.rs index 6b2641c..5b0f996 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,21 @@ use hyper_tls::HttpsConnector; -use hyper::{Client, Uri}; +use hyper::{Body, Client, Method, Request}; use std::str; +use dotenv::dotenv; #[tokio::main] async fn main() -> Result<(), Box> { + dotenv().ok(); + let https = HttpsConnector::new(); let client = Client::builder().build::<_, hyper::Body>(https); + let req = Request::builder() + .method(Method::POST) + .uri(dotenv::var("LYCHEE_ENDPOINT").unwrap()) + .body(Body::empty()) + .expect("error"); + let res = client.request(req).await?; - let res = client.get(Uri::from_static("https://test.louis-vallat.xyz")).await?; println!("{}", res.status().as_u16()); let buf = hyper::body::to_bytes(res).await?;