#http-client #wasi

wasi-http-client

WASI 的 HTTP 客户端库

4 个版本

0.2.1 2024 年 5 月 20 日
0.2.0 2024 年 5 月 20 日
0.1.1 2024 年 5 月 13 日
0.1.0 2024 年 5 月 11 日

WebAssembly 中排名第 1342

每月下载量 27

Apache-2.0

17KB
291

wasi-http-client

WASI 预览 2 的 HTTP 客户端库,使 WASI 组件中的 http(s) 请求变得更容易。

let resp = Client::new()
    .post("https://httpbin.org/post")
    .connect_timeout(Duration::from_secs(5))
    .send()?;

println!("status code: {}", resp.status());

lib.rs:

wasi-http-client

wasi_http_client 是 WASI 预览 2 的 HTTP 客户端库,使 WASI 组件中的 http(s) 请求变得更容易。

let resp = Client::new()
    .post("https://httpbin.org/post")
    .connect_timeout(Duration::from_secs(5))
    .send()?;

println!("status code: {}", resp.status());

依赖关系

~3MB
~80K SLoC