Stream: general

Topic: How do I construct a preview 3 Request without trailers?


view this post on Zulip mainrs (Jun 02 2025 at 14:54):

https://github.com/WebAssembly/wasi-http/blob/d163277b8684483a2334363ca1492ca298ea526d/wit-0.3.0-draft/types.wit

I do not understand how to construct the tailers parameter of the request constructor. It expects a future<result<option<trailers>, error-code>>. In my case all requests do not have any trailers.

Would I have to write a future that directly resolves to Ok(None)? Thanks!

Contribute to WebAssembly/wasi-http development by creating an account on GitHub.

view this post on Zulip Lann Martin (Jun 02 2025 at 15:39):

Would I have to write a future that directly resolves to Ok(None)?

Yep. The main point of trailers is that you don't (necessarily) know what they are until the body has been processed, so for a general-purpose interface we need some way to make that async.

view this post on Zulip mainrs (Jun 02 2025 at 15:50):

Thank you!

view this post on Zulip riking (Jun 03 2025 at 19:54):

Write a Future combinator named ready in your support library, to construct any immediately resolved future


Last updated: Dec 06 2025 at 05:03 UTC