File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ version = "0.1.0"
5
5
edition = " 2021"
6
6
7
7
[dependencies ]
8
- hyper = { version = " 0.14.18" , features = [" client" ] }
9
- hyper-rustls = " 0.23.0"
10
- rustls = " 0.22"
11
- tokio = { version = " 1.18.2" , features = [" rt-multi-thread" , " macros" ] }
8
+ http-body-util = " 0.1.2"
9
+ hyper = { version = " 1.6.0" , features = [" client" ] }
10
+ hyper-rustls = " 0.27.5"
11
+ hyper-util = " 0.1.10"
12
+ rustls = " 0.23"
13
+ tokio = { version = " 1.43.0" , features = [" rt-multi-thread" , " macros" ] }
Original file line number Diff line number Diff line change 1
- use hyper:: { Body , Client , StatusCode , Uri } ;
1
+ use http_body_util:: Empty ;
2
+ use hyper:: body:: Bytes ;
3
+ use hyper:: http:: StatusCode ;
4
+ use hyper_util:: client:: legacy:: Client ;
5
+ use hyper_util:: rt:: TokioExecutor ;
2
6
3
7
#[ tokio:: main]
4
8
async fn main ( ) {
5
9
let url = ( "https://hyper.rs" ) . parse ( ) . unwrap ( ) ;
6
10
let https = hyper_rustls:: HttpsConnectorBuilder :: new ( )
7
11
. with_native_roots ( )
12
+ . expect ( "no native root CA certificates found" )
8
13
. https_only ( )
9
14
. enable_http1 ( )
10
15
. build ( ) ;
11
16
12
- let client: Client < _ , hyper :: Body > = Client :: builder ( ) . build ( https) ;
17
+ let client: Client < _ , Empty < Bytes > > = Client :: builder ( TokioExecutor :: new ( ) ) . build ( https) ;
13
18
14
19
let res = client. get ( url) . await . unwrap ( ) ;
15
20
assert_eq ! ( res. status( ) , StatusCode :: OK ) ;
You can’t perform that action at this time.
0 commit comments