I was able to get up and running with making outbound HTTP requests using the HTTP components, but given some things like the mechanics of needing to drop streams before sending the body or all of the manual request setup it seems like the low-level API is not incredibly friendly for general use cases. Are there any example implementations of JS fetch
-like or Rust reqwest
-like libraries that provide simpler APIs?
I believe @Till Schneidereit has implemented fetch
for JS, and @Lann Martin has done some work porting Hyper. I've done some work integrating wasi-http
with Python's asyncio
(example), but haven't tried to port an existing Python HTTP library yet.
correct, I have a fairly compliant implementation of fetch
that'll be public very soon
more generally, I agree that wasi-http is too complex to use in its raw form. I hope that's something we can address in the future, and potentially by introducing higher-level APIs in addition
Is there an on-going work to create a JS fetch
-like or Rust reqwest
-like libraries to provide a simpler API ?
I'm trying to find a simple way to run wasi module to fetch some API
When using wasi-http the stream based 0.3 api will be a pretty nice api out of the box though I bet communities in each language will want to use what's common there on top still (like fetch, reqwest, curl, etc)
@Yoshua Wuyts has this Rust crate that provides a higher level api on top of wasi-http 0.2: https://github.com/yoshuawuyts/wasm-http-tools/tree/main/crates/wasi-http-client
Last updated: Nov 22 2024 at 17:03 UTC