File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use futures_util::future::BoxFuture;
44use http_types:: Body ;
55
66use surf:: { middleware:: Next , Client , Request , Response } ;
7-
87#[ async_std:: test]
98async fn post_json ( ) -> Result < ( ) , http_types:: Error > {
109 #[ derive( serde:: Deserialize , serde:: Serialize ) ]
@@ -47,6 +46,20 @@ async fn get_json() -> Result<(), http_types::Error> {
4746 Ok ( ( ) )
4847}
4948
49+ #[ async_std:: test]
50+ async fn head_example_org ( ) -> Result < ( ) , http_types:: Error > {
51+ let mut res = surf:: head ( "http://example.com" ) . await ?;
52+
53+ assert_eq ! ( res. status( ) , surf:: StatusCode :: Ok ) ;
54+ assert ! ( res. len( ) . is_some( ) ) ;
55+
56+ let body = res. body_bytes ( ) . await ?;
57+
58+ assert_eq ! ( body. len( ) , 0 ) ;
59+
60+ Ok ( ( ) )
61+ }
62+
5063#[ async_std:: test]
5164async fn get_google ( ) -> Result < ( ) , http_types:: Error > {
5265 femme:: start ( log:: LevelFilter :: Trace ) . ok ( ) ;
You can’t perform that action at this time.
0 commit comments