Interface: http
Generated from zaun:bot@0.2.0 (wit/ in zaun-bot). Do not edit.
Outbound HTTPS to hosts in the bot’s network grant. The request leaves from the host,
so the remote server learns the host’s address.
The local_network grant adds exact host:port addresses next to the host (a media
server on the same machine, say), reached over http:// or https://. Only those
addresses skip the private-address refusal; the operator’s ceiling decides whether any
may be granted.
Functions
Section titled “Functions”fetch: func(req: request) -> result<response, http-error>;request
Section titled “request”record
| Member | Description |
|---|---|
method: string |
|
url: string |
|
headers: list<tuple<string, string>> |
|
body: option<list<u8>> |
|
timeout-ms: option<u32> |
response
Section titled “response”record
| Member | Description |
|---|---|
status: u16 |
|
headers: list<tuple<string |
|
string>> |
|
body: list<u8> |
http-error
Section titled “http-error”variant
| Member | Description |
|---|---|
not-granted(string) |
The host (or host:port) is not in the bot’s network or local_network grant, or not in the operator’s ceiling. |
refused-address |
The name resolved to a loopback, private, link-local or reserved address, and the address is not a local_network grant. |
invalid-url |
Malformed, or not https:// (http:// only for local_network addresses). |
timeout |
|
too-large |
|
transport(string) |