Network & HTTP
HTTP verbs for fetching data, calling external APIs, downloading files, pinging hosts, and resolving DNS.
| Verb | Description |
|---|---|
FETCH "url" / GET "url" | HTTP GET — auto-parses JSON response. GET and FETCH are identical. |
POST "url" WITH ?body | HTTP POST with JSON body |
PUT "url" WITH ?body | HTTP PUT |
DELETE "url" | HTTP DELETE |
FETCH "url" WITH ?headers AS "raw" | Request with custom headers — returns raw text |
PING "host" | ICMP ping — returns latency in ms or null on failure |
RESOLVE "hostname" | DNS lookup — returns IP address array |
DOWNLOAD "url" INTO "/root/file" | Download file directly to filesystem |
UPLOAD "/root/file" TO "url" | Upload a file via HTTP POST multipart |
CONNECT "host:port" | Open a raw TCP connection — returns connection handle |
FETCH / GET
FETCH "https://httpbin.org/uuid" SET ?r
AFTER EMIT ?r(uuid)
Try it ›
POST
NEW JSON OBJECT
OPEN NEST
SET "name" AS "test"
AND SET "value" AS "42"
CLOSE NEST
SET ?body
AFTER POST "https://httpbin.org/post" WITH ?body SET ?resp
AFTER EMIT ?resp(json)(name)
Try it ›
Custom headers
NEW JSON OBJECT
OPEN NEST
SET "Authorization" AS "Bearer my-token"
AND SET "X-Custom" AS "oql"
CLOSE NEST
SET ?headers
AFTER FETCH "https://httpbin.org/headers" WITH ?headers AS "raw" SET ?raw
AFTER EMIT ?raw
DOWNLOAD
DOWNLOAD "https://httpbin.org/json" INTO "/root/data/response.json" SET ?path
AFTER EMIT ?path
PING / RESOLVE
PING "ocalt.com" SET ?ms
AFTER EMIT "Latency: " & ?ms & "ms"
RESOLVE "ocalt.com" SET ?ips
AFTER EMIT ?ips
Try it ›