File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ matrix:
1414 env : BUILD_DOCS=1
1515 - rust : nightly
1616 os : osx
17+ osx_image : xcode9.2
1718 env : BUILD_DOCS=1
1819 - rust : nightly-x86_64-pc-windows-msvc
1920 os : windows
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ mio-uds = "0.6.7"
3636num_cpus = " 1.10.0"
3737pin-utils = " 0.1.0-alpha.4"
3838slab = " 0.4.2"
39+ surf = " 1.0.1"
3940
4041[dev-dependencies ]
4142femme = " 1.1.0"
Original file line number Diff line number Diff line change 1+ //! Sends an HTTP request to the Rust website.
2+
3+ #![ feature( async_await) ]
4+
5+ use async_std:: task;
6+
7+ fn main ( ) -> Result < ( ) , surf:: Exception > {
8+ task:: block_on ( async {
9+ let url = "https://www.rust-lang.org" ;
10+ let mut response = surf:: get ( url) . await ?;
11+ let body = response. body_string ( ) . await ?;
12+
13+ dbg ! ( url) ;
14+ dbg ! ( response. status( ) ) ;
15+ dbg ! ( response. version( ) ) ;
16+ dbg ! ( response. headers( ) ) ;
17+ dbg ! ( body. len( ) ) ;
18+
19+ Ok ( ( ) )
20+ } )
21+ }
You can’t perform that action at this time.
0 commit comments