leyline-http 0.1.5

HTTP client that impersonates Chrome, Firefox, and Safari on the wire: TLS (JA3/JA4), HTTP/2, and HTTP/3 fingerprints
Documentation
use leyline::Session;
use serde::Serialize;

const URL: &str = "https://example.com/users";

#[derive(Serialize)]
struct CreateUser {
    name: &'static str,
    age: u32,
}

#[tokio::main]
async fn main() -> leyline::Result<()> {
    let session = Session::builder().build()?;

    let payload = CreateUser {
        name: "ada",
        age: 36,
    };

    let resp = session.post(URL).json(&payload).send().await?;

    println!("status: {}", resp.status());
    println!("body:   {}", resp.text().await?);
    Ok(())
}