HTTP client builtins
10 builtins of Soma 3.2.4 in the category HTTP client, with their exact signatures, as soma describe --builtins --json prints them.
http_get
http_get(url: String, opts?: {timeout, max_bytes, headers}) -> Map|List|StringGET a URL. 2xx: the body (JSON parsed). Never raises on the network or a status: otherwise {error, kind, status, body}; an invalid or unknown option raises kind type — kind http_status (status + the upstream body), timeout, refused or network. timeout defaults to 30000 ms.
http_post
http_post(url: String, body, opts?: {timeout, max_bytes, headers}) -> Map|List|StringPOST body (a Map/List is sent as JSON, a String as is). Same result shape and default timeout as http_get. Also http_put, http_patch, http_delete(url, opts?).
http_put
http_put(url: String, body, opts?) -> Map|List|StringPUT; same shape as http_post.
http_patch
http_patch(url: String, body, opts?) -> Map|List|StringPATCH; same shape as http_post.
http_delete
http_delete(url: String, opts?) -> Map|List|StringDELETE; same shape as http_get.
ws_connect
ws_connect(url: String) -> MapOpen a send-only WebSocket connection for ws_send() → {status, url}; replies are not read (receive with subscribe(url), which dispatches {"event", "data"} messages and reconnects after a drop).
ws_send
ws_send(msg) -> ()Send a message on the current WebSocket connection; errors if not connected.
link
link(addr: "host:port") -> ()Open a TCP signal-bus link to a peer node.
subscribe
subscribe(url: String) -> ()Subscribe to a remote event stream; an {"event", "data"} message runs on event(data) only for an event this program emits or soma.toml [bus] accept lists (else refused); other text runs on ws(msg).
refusal
refusal(kind: String, detail?: String) -> MapAn HTTP response — status from the kind (conflict → 409, not_found → 404, unauthorized → 401, your own tag → 400) and body {error, kind, detail}, exactly what RAISING that error would answer. Return it when the handler must refuse AND keep what it wrote (an audit row): raising rolls the writes back, returning does not. It is a response envelope like response(): read the fields through _body (r._body.kind), and return it as the handler's value.