Skip to content

HTTP is the foundation of data exchange on the web. Tenzir provides operators for all sides of an HTTP conversation: fetching data from APIs, sending events to webhooks, streaming data to clients, and accepting incoming requests.

When retrieving data from an API or website, you prepare your HTTP request and get back the HTTP response body as your pipeline data:

HTTP ResponseHTTP Requestfrom "http://example.com", Request LineHeadersBodyHeadersBodyStatus LineWebServerheaders={Token: "secrect"}, data={key: "value"}

Use from_http to issue a one-shot HTTP request, or http to enrich events flowing through a pipeline with HTTP responses. Both operators automatically infer the response format from the URL extension or Content-Type header.

See the Fetch via HTTP and APIs guide for practical examples covering authentication, pagination, error handling, and data enrichment.

Use to_http to send events as HTTP requests to a webhook or API endpoint. Each input event is sent as a separate request, with the event JSON-encoded as the body by default. This is useful for pushing alerts to webhooks, forwarding events to SIEMs, or calling external APIs for each event.

HTTP Responseto "http://example.com", HeadersBodyStatus LineHTTP RequestRequest LineHeadersBodyWebServerheaders={Token: "secrect"}

Use serve_http to start an HTTP server that streams pipeline events as NDJSON to connected clients. Each client receives a copy of every event. This is useful when external systems need to pull data from your pipeline over HTTP.

See the Expose data as a server guide for practical examples covering health checks, connection limits, and TLS.

Use accept_http to spin up an HTTP server that turns incoming requests into pipeline events. This is useful for receiving webhooks, building custom API endpoints, or ingesting data pushed by external systems.

All HTTP operators support TLS. Pass tls={} to enable TLS with defaults, or provide a record with specific options like certfile and keyfile.

Last updated: