bitreq 0.3.5

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

fn main() -> Result<(), bitreq::Error> {
    let runtime = tokio::runtime::Builder::new_current_thread()
        .build()
        .expect("failed to build Tokio runtime");

    runtime.block_on(async {
        let response = bitreq::get("http://httpbin.org/get").send_async().await?;

        println!("Status: {}", response.status_code);
        println!("Body: {}", response.as_str()?);

        Ok(())
    })
}