File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use futures_util::future::BoxFuture;
4
4
use http_types:: Body ;
5
5
6
6
use surf:: { middleware:: Next , Client , Request , Response } ;
7
-
8
7
#[ async_std:: test]
9
8
async fn post_json ( ) -> Result < ( ) , http_types:: Error > {
10
9
#[ derive( serde:: Deserialize , serde:: Serialize ) ]
@@ -47,6 +46,21 @@ async fn get_json() -> Result<(), http_types::Error> {
47
46
Ok ( ( ) )
48
47
}
49
48
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
+
63
+
50
64
#[ async_std:: test]
51
65
async fn get_google ( ) -> Result < ( ) , http_types:: Error > {
52
66
femme:: start ( log:: LevelFilter :: Trace ) . ok ( ) ;
You can’t perform that action at this time.
0 commit comments