Skip to content

Keyword http

Oliver Atkinson edited this page May 10, 2026 · 1 revision

http

Performs an HTTP request and returns a JSON response object.

http is in the default computer. It is an async returns keyword, so runtime streams can update when the request result changes.

Shape

{
  "{returns}": {
    "http": {
      "request": {
        "url": "https://example.com/api",
        "method": "GET",
        "headers": {
          "Accept": "application/json"
        },
        "body": null,
        "timeout": 30
      }
    }
  }
}

method, headers, body, and timeout are optional.

Response Shape

The result includes:

{
  "body": {},
  "headers": {},
  "status": 200,
  "url": "https://example.com/api"
}

body is decoded as JSON when possible. Non-JSON text responses return a string body.

Example with computed URL

{
  "{returns}": {
    "http": {
      "request": {
        "url": { "{returns}": { "from": { "reference": "api.users.url" } } },
        "headers": {
          "Authorization": { "{returns}": { "item": ["token"] } }
        }
      }
    }
  }
}

Clone this wiki locally