1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crateStreamEchoClient;
use HttpProtocol;
/// HTTP echo client that connects to HTTP echo servers
///
/// This is a type alias for `StreamEchoClient<HttpProtocol>`.
/// It sends HTTP requests and receives HTTP responses.
///
/// # Examples
///
/// Basic client usage:
///
/// ```no_run
/// use echosrv::http::HttpEchoClient;
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let addr = "127.0.0.1:8080".parse()?;
/// let mut client = HttpEchoClient::connect(addr).await?;
///
/// let response = client.echo_string("Hello, HTTP Server!").await?;
/// println!("Server echoed: {}", response);
/// Ok(())
/// }
/// ```
///
/// Sending binary data:
///
/// ```no_run
/// use echosrv::http::HttpEchoClient;
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let addr = "127.0.0.1:8080".parse()?;
/// let mut client = HttpEchoClient::connect(addr).await?;
///
/// let data = b"Binary data";
/// let response = client.echo(data).await?;
/// println!("Server echoed {} bytes", response.len());
/// Ok(())
/// }
/// ```
pub type HttpEchoClient = ;