minreq 2.6.0

Simple, minimal-dependency HTTP client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// This example demonstrates the `json-using-serde` feature.

#[derive(serde_derive::Deserialize)]
struct Response {
    data: String,
}

fn main() -> Result<(), minreq::Error> {
    let response = minreq::get("http://httpbin.org/anything")
        .with_body("Hello, world!")
        .send()?;
    let json: Response = response.json()?;
    println!("{}", json.data);
    Ok(())
}