File tree Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,5 @@ slab = "0.4.2"
35
35
36
36
[dev-dependencies ]
37
37
femme = " 1.1.0"
38
- # surf = { git = "ssh://github.com/yoshuawuyts/surf" }
38
+ surf = " 1.0.1 "
39
39
tempdir = " 0.3.7"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //! Creates a web 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