1 use test_programs::wasi::http::types::{ErrorCode, Method, Scheme};
2 
main()3 fn main() {
4     let res = test_programs::http::request(
5         Method::Get,
6         Scheme::Other("WS".to_owned()),
7         "localhost:3000",
8         "/",
9         None,
10         None,
11         None,
12         None,
13         None,
14     );
15 
16     assert!(matches!(
17         res.unwrap_err()
18             .downcast::<ErrorCode>()
19             .expect("expected a wasi-http ErrorCode"),
20         ErrorCode::HttpProtocolError,
21     ));
22 }
23