Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Options #48

Open
jedisct1 opened this issue Mar 30, 2021 · 1 comment
Open

Options #48

jedisct1 opened this issue Mar 30, 2021 · 1 comment

Comments

@jedisct1
Copy link
Contributor

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.

@jedisct1
Copy link
Contributor Author

Something similar was done in wasi-crypto: https://github.com/WebAssembly/wasi-crypto/blob/main/docs/wasi-crypto.md#options

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant