minreq 2.6.0

Simple, minimal-dependency HTTP client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
/// This is a simple example to demonstrate the usage of this
/// library. The printed string is quite a bit of JSON, which you
/// might want to handle with the `json-using-serde` feature. For
/// that, check out examples/json.rs!

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