example: debug print client "any" client

Doesn't actually play nice with hyper and wasm, oh well.
This commit is contained in:
Jeremiah Senkpiel 2021-02-12 12:05:03 -08:00
parent 0bc9585cc5
commit 492f72c2e1
2 changed files with 22 additions and 15 deletions

View File

@ -1,15 +0,0 @@
#![cfg(feature = "h1_client")]
use http_client::{h1::H1Client, HttpClient};
use http_types::{Method, Request};
#[async_std::main]
async fn main() {
let client = H1Client::new();
let req = Request::new(Method::Get, "http://example.org");
client.send(req).await.unwrap();
dbg!(client);
}

View File

@ -0,0 +1,22 @@
use http_client::HttpClient;
use http_types::{Method, Request};
#[cfg(any(feature = "h1_client", feature = "docs"))]
use http_client::h1::H1Client as Client;
#[cfg(all(feature = "hyper_client", not(feature = "docs")))]
use http_client::hyper::HyperClient as Client;
#[cfg(all(feature = "curl_client", not(feature = "docs")))]
use http_client::isahc::IsahcClient as Client;
#[cfg(all(feature = "wasm_client", not(feature = "docs")))]
use http_client::wasm::WasmClient as Client;
#[async_std::main]
async fn main() {
let client = Client::new();
let req = Request::new(Method::Get, "http://example.org");
client.send(req).await.unwrap();
dbg!(client);
}