Easy to send HTTP/HTTPS requests.

cargo add tomcat
tokio = { version = "1.21.2", features = ["full"] }
tomcat = "0.1.1"
Examples
non-blocking
#[tokio::main]
async fn main(){
use tomcat::*;
if let Ok(res) = get("https://www.spacex.com").await{
assert_eq!(200,res.status);
assert_eq!(r#"{"content-type": "text/html; charset=utf-8", "vary": "Accept-Encoding", "date": "Sun, 09 Oct 2022 18:49:44 GMT", "connection": "keep-alive", "keep-alive": "timeout=5", "transfer-encoding": "chunked"}"#,format!("{:?}",res.headers));
println!("{}",res.text);
println!("{}",res.text_with_charset);
println!("{}",res.url);
println!("{}",res.remote_addr);
println!("{:?}",res.version);
}
}
blocking
fn main(){
use tomcat::*;
if let Ok(res) = get_blocking("https://www.spacex.com"){
assert_eq!(200,res.status);
assert_eq!(r#"{"content-type": "text/html; charset=utf-8", "vary": "Accept-Encoding", "date": "Sun, 09 Oct 2022 18:49:44 GMT", "connection": "keep-alive", "keep-alive": "timeout=5", "transfer-encoding": "chunked"}"#,format!("{:?}",res.headers));
println!("{}",res.text);
println!("{}",res.text_with_charset);
println!("{}",res.url);
println!("{}",res.remote_addr);
println!("{:?}",res.version);
}
}