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 pipeline output to clients, and accepting incoming requests.
Fetching data from APIs
Section titled “Fetching data from APIs”When retrieving data from an API or website, you prepare your HTTP request and get back the HTTP response body as your pipeline data:
Use from_http to issue a one-shot HTTP
request and stream the response body chunks into its parser sub-pipeline as
they arrive. The operator automatically infers 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.
Sending data to webhooks and APIs
Section titled “Sending data to webhooks and APIs”Use to_http to send events to a webhook or
API endpoint as a single HTTP request per operator invocation. A printer
sub-pipeline turns the input events into the request body bytes, which Tenzir
streams directly into the outgoing request. This is useful for pushing alerts
to webhooks, forwarding events to SIEMs, or sending periodic batches to
external APIs.
Streaming data to HTTP clients
Section titled “Streaming data to HTTP clients”Use serve_http to start an HTTP server that streams the bytes produced
by a nested pipeline to connected clients. For example, use
write_ndjson when you want NDJSON over HTTP or write_lines
when you want plain text.
See the Expose data as a server guide for practical examples covering serialization, connection limits, and TLS.
Accepting incoming requests
Section titled “Accepting incoming requests”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.
SSL/TLS
Section titled “SSL/TLS”All HTTP operators support TLS. Pass tls={} to enable TLS with defaults, or
provide a record with specific options like certfile and keyfile.