2019-10-01 17:23:41 +00:00
|
|
|
/* TODO: Once the next version of surf released, re-enable this example.
|
2019-08-18 17:14:27 +00:00
|
|
|
//! Sends an HTTP request to the Rust website.
|
|
|
|
|
|
|
|
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(())
|
|
|
|
})
|
|
|
|
}
|
2019-10-01 17:23:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
fn main() {}
|