surf 1.0.3

HTTP client framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use async_std::task;

// The need for Ok with turbofish is explained here
// https://rust-lang.github.io/async-book/07_workarounds/03_err_in_async_blocks.html
fn main() -> Result<(), surf::Exception> {
    femme::start(log::LevelFilter::Info)?;

    task::block_on(async {
        let uri = "https://httpbin.org/get";
        let string: String = surf::get(uri).recv_string().await?;
        println!("{}", string);
        Ok::<(), surf::Exception>(())
    })
}