deislabs/wasi-experimental-http

Options

jedisct1 opened this issue · 1 comments

Applications may want to access the content via a proxy. Or to disable certificate verification. Or to limit the bandwidth. Or force HTTP/2 or HTTP/3 usage. Or set whatever knobs a specific runtime provides.

curl has a bazillion options. And applications actually use these.

We can't possibly add extra parameters for all of these, especially as new needs may come up over time.

So, maybe what we can do is introduce an Options handle, on top of which (key, value)-type options can be set.
And the req() function optionally accepts such a handle.

This allows the API to be extended, even with implementation-specific features, without breaking it.