File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
use async_h1:: { client, Body } ;
2
2
use async_std:: { io, net, task} ;
3
- use http:: Response ;
4
3
5
4
fn main ( ) -> Result < ( ) , async_h1:: Exception > {
6
5
task:: block_on ( async {
@@ -9,8 +8,8 @@ fn main() -> Result<(), async_h1::Exception> {
9
8
let body = Body :: from_string ( "hello chashu" . to_owned ( ) ) ;
10
9
let mut req = client:: encode ( http:: Request :: new ( body) ) . await ?;
11
10
io:: copy ( & mut req, writer) . await ?;
12
- let res: Response < Body < io :: BufReader < & mut & async_std :: net :: TcpStream > > > = client:: decode ( reader) . await ?;
11
+ let res = client:: decode ( reader) . await ?;
13
12
println ! ( "Response {:?}" , res) ;
14
- Ok :: < ( ) , async_h1 :: Exception > ( ( ) )
13
+ Ok ( ( ) )
15
14
} )
16
15
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ fn main() -> Result<(), async_h1::Exception> {
14
14
let ( reader, writer) = & mut ( & stream, & stream) ;
15
15
let req = server:: decode ( reader) . await ?;
16
16
if req. is_some ( ) {
17
+ // dbg!(req);
17
18
let body = Body :: from_string ( "hello chashu" . to_owned ( ) ) ;
18
19
let mut res = server:: encode ( http:: Response :: new ( body) ) . await ?;
19
20
io:: copy ( & mut res, writer) . await ?;
You can’t perform that action at this time.
0 commit comments