Skip to content
← Back to Index

http ​

Keyword

 http(request: { method?, url: text, headers?, body? }): { status: number, headers, body } 

The http keyword is the egress runtime's outbound HTTP transport. It performs the actual HTTP call for an egress component — unlike the deprecated reactor web.http module, there is no allowedHosts gate, because the existence of the egress resource is the host allowlist.

It is only available inside egress components.

The request record:

FieldRequiredDescription
methodNoGET (default), HEAD, POST, PUT, DELETE, or PATCH.
urlYesThe absolute URL to call.
headersNoMap of header name to value.
bodyNoThe request body.

The result:

filtrera
{ status: number, headers: { text -> [text] }, body: value }

http is total — it never throws. A failure that never reached a status line at all (DNS, TLS, a refused connection, a timeout) answers with status = 0 and the reason as the body, rather than claiming a server answered. Handle it like any other response:

filtrera
from
  http { url = 'https://partner.example.test/session' method = 'POST' body = { id = id } }
  match
    { status = 200, body = { token } } |> { session = token }
    { status = 0, body = reason } |> { error = { code = 'UNREACHABLE', message = reason } }
    { status = s } |> { error = { code = 'HTTP_' + s } }

Availability ​

PromotionRuleReactorEgress
✓

Examples ​

Simple GET ​

filtrera
from http { url = 'https://partner.example.test/pricelists' }

Authenticated POST ​

filtrera
from http {
  url = 'https://partner.example.test/session'
  method = 'POST'
  headers = { 'Authorization' -> 'Bearer ' + token }
  body = { configurationId = 'cfg_123' }
}

Credentials are resolved inside the egress component (for example from the registry) so they never enter the calling reactor, rule, or job.

See Also ​

  • Egresses — the resource that owns the destination and the ACL
  • registry — reading configuration and secrets

© 2026 Hantera AB. Org. no.: 559242-9582