mirror of https://github.com/http-rs/http-client
example: debug print client "any" client
Doesn't actually play nice with hyper and wasm, oh well.
This commit is contained in:
parent
0bc9585cc5
commit
492f72c2e1
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue