-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathclient.wit
25 lines (20 loc) · 942 Bytes
/
client.wit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package wasi:[email protected];
/// The `wasi:http/client` world captures making outgoing HTTP requests.
world client {
/// HTTP proxies have access to time and randomness.
include wasi:clocks/[email protected];
import wasi:random/[email protected];
/// Proxies have standard output and error streams which are expected to
/// terminate in a developer-facing console provided by the host.
import wasi:cli/[email protected];
import wasi:cli/[email protected];
/// TODO: this is a temporary workaround until component tooling is able to
/// gracefully handle the absence of stdin. Hosts must return an eof stream
/// for this import, which is what wasi-libc + tooling will do automatically
/// when this import is properly removed.
import wasi:cli/[email protected];
/// This is the default handler to use when user code simply wants to make an
/// HTTP request (e.g., via `fetch()`).
import outgoing-handler;
export wasi:cli/[email protected];
}