一个实用的 HTTP 客户端,使用起来很有趣。
向 Isahc (发音像《伊萨克》) 致以问候,这是一个实用的 HTTP 客户端,使用起来很有趣。
Isahc 是一个缩写,代表 Incredible Streaming Asynchronous HTTP Client,正如名称所示,它是一个用于 [Rust] 语言的异步 HTTP 客户端。它在内部使用 [libcurl] 作为 HTTP 引擎,并在顶层提供了易于使用的 API,可与 Rust 习惯语融合。
请查看 [文档] 了解 Isahc 能做什么以及如何使用它。为了帮助您开始使用,这里有一个非常简单、完整的示例,它会从 https://example.org: 和 ```rust use isahc::prelude::*;
fn main() -> Result {
// Send a GET request and wait for the response headers.
// Must be mut so we can read the response body.
let mut response = isahc::get("https://example.org")?;
// Print some basic info about the response to standard output.
println!("Status: {}", response.status());
println!("Headers: {:#?}", response.headers());
// Read the response body as text into a string and print it.
print!("{}", response.text()?);
Ok(())
}
[][documentation]暂无开放 Issues,或尚未同步最近议题。