async-std/examples/surf-web.rs
Alex Macleod 1b7d5bea6b Enable surf example
1.0.3 has been released with the required change
2019-11-12 12:19:11 +00:00

17 lines
411 B
Rust

use async_std::task;
fn main() -> Result<(), surf::Exception> {
task::block_on(async {
let url = "https://www.rust-lang.org";
let mut response = surf::get(url).await?;
let body = response.body_string().await?;
dbg!(url);
dbg!(response.status());
dbg!(response.version());
dbg!(response.headers());
dbg!(body.len());
Ok(())
})
}