Skip to content
Sign in

http

v0.22.8

Expose functions as HTTP endpoints — hosts `http::on-request`; each observer of it declares a route, and its target answers the matched requests.

license: Apache-2.0Used in 1 kitapiendpointhttprest

Install

bash
iii trigger compose::add worker=http@0.22.8

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions6

http

Function

HTTP API trigger

Request
  • api_pathstringrequired
  • condition_function_idstring
  • http_methodstring
  • middleware_function_idsstring[]
  • public_webhookboolean

    Also expose this route on the restricted webhook listener. Explicit opt-in only; the default keeps existing routes on the normal listener.

Response
  • bodyunknownrequired
  • headersobjectrequired
  • methodstringrequired
  • pathstringrequired
  • path_paramsobjectrequired
  • query_paramsobjectrequired
  • request_bodyobjectrequired
    • access_keystringrequired
    • channel_idstringrequired
    • directionstringrequiredenum read, write
  • responseobjectrequired
    • access_keystringrequired
    • channel_idstringrequired
    • directionstringrequiredenum read, write
  • triggerany of
    any of (2)
    Variant 1
    • methodstring
    • pathstring
    • typestringrequired
    Variant 2
    valuenull

http::configuration-id

Function

Returns this HTTP instance's configuration entry ID, without its value.

Request
Empty object
Response
  • idstringrequired

http::on-config-change

Function

Internal: reload http configuration from the authoritative store on change.

Request
Empty object
Response
  • okbooleanrequired

http::on-request

Function

One event per HTTP request. Observe it with args { method, path } (plus optional public_webhook, middleware_function_ids and the deprecated condition_function_id) to serve that route: each matching request invokes the target with the HTTP request, and its return value ({ status_code, headers, body }, or null after streaming to the response channel) is the response. Filters are evaluated against the request as `input`; a request they reject gets 422. Only the http worker routes requests: invoking it directly is refused.

Request
  • bodyunknownrequired
  • headersobjectrequired
  • methodstringrequired
  • pathstringrequired
  • path_paramsobjectrequired
  • query_paramsobjectrequired
  • request_bodyobjectrequired
    • access_keystringrequired
    • channel_idstringrequired
    • directionstringrequiredenum read, write
  • responseobjectrequired
    • access_keystringrequired
    • channel_idstringrequired
    • directionstringrequiredenum read, write
  • triggerany of
    any of (2)
    Variant 1
    • methodstring
    • pathstring
    • typestringrequired
    Variant 2
    valuenull
Response
  • bodyunknown

    JSON by default; a string or raw value with a non-JSON content-type

  • headersobject

    An object of header values, or a list of "Name: value" lines

  • status_codeinteger

http::status

Function

Where the public HTTP server listens: its host, its port and the base URL to open from this machine (for example http://127.0.0.1:3111). Read-only; use it instead of assuming port 3111.

Request
Empty object
Response
  • hoststring

    The bound interface (`0.0.0.0` serves every network interface). None while the server is stopped.

  • last_reload_errorstring

    Last configuration reload failure, e.g. the port is already in use; cleared by the next successful reload.

  • portinteger· uint16min 0

    The bound port (the OS-assigned one for port 0). None while stopped.

  • urlstring

    The base URL to open from this machine, e.g. `http://127.0.0.1:3111`: loopback when the server listens on every interface.

http::webhook-listener::status

Function

Internal: the restricted webhook listener this process has actually bound and the last reload error.

Request
Empty object
Response
  • appliedany of

    The listener this process has bound: the last successfully applied configuration (a failed bind keeps the previous one). None when the listener is off or the server is stopped.

    any of (2)
    Variant 1
    • hoststring

      Loopback by default; expose only this listener through a reverse proxy.

    • portinteger· uint16min 0

      Restricted port, separate from the normal listener (3111).

    Variant 2
    valuenull
  • last_reload_errorstring

    Last configuration reload failure, e.g. the port is already in use; cleared by the next successful reload.

Search the registry

Find workers, kits and executables, or jump to a page.