Skip to content

Commit 492f72c

Browse files
committed
example: debug print client "any" client
Doesn't actually play nice with hyper and wasm, oh well.
1 parent 0bc9585 commit 492f72c

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

examples/debug_h1_client.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/print_client_debug.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use http_client::HttpClient;
2+
use http_types::{Method, Request};
3+
4+
#[cfg(any(feature = "h1_client", feature = "docs"))]
5+
use http_client::h1::H1Client as Client;
6+
#[cfg(all(feature = "hyper_client", not(feature = "docs")))]
7+
use http_client::hyper::HyperClient as Client;
8+
#[cfg(all(feature = "curl_client", not(feature = "docs")))]
9+
use http_client::isahc::IsahcClient as Client;
10+
#[cfg(all(feature = "wasm_client", not(feature = "docs")))]
11+
use http_client::wasm::WasmClient as Client;
12+
13+
#[async_std::main]
14+
async fn main() {
15+
let client = Client::new();
16+
17+
let req = Request::new(Method::Get, "http://example.org");
18+
19+
client.send(req).await.unwrap();
20+
21+
dbg!(client);
22+
}

0 commit comments

Comments
 (0)