Stream: wasi

Topic: wasi-fetch — reqwest-style HTTP client on wasi:http@0.3.0


view this post on Zulip Alexander Shishenko (Aug 04 2026 at 08:53):

Sharing a small Rust crate in case it's useful to others: https://github.com/actcore/wasi-fetch (wasi-fetch on crates.io, MIT/Apache-2.0). It's the ~100 lines of wasip3 HTTP boilerplate I kept copy-pasting across components - Fields::from_list, the wit_stream body writer, the trailers wit_future stub, RequestOptions, the read loop - factored out behind a reqwest-shaped builder:

let resp = Client::new()
    .post("https://api.example.com/things")
    .header("authorization", "Bearer ...")
    .json(&payload)
    .send()
    .await?;
let thing: Thing = resp.into_body().json().await?;

It returns http::Response<Body> where Body: http_body::Body, so it composes with the rest of the http ecosystem rather than inventing its own types.


Last updated: Aug 31 2026 at 10:09 UTC