Skip to content

Tenzir supports HTTP and HTTPS, both as sender and receiver.

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"}

When sending data from a pipeline to an API or website, the events in the pipeline make up the HTTP request body. If the HTTP status code is not 2**, you will get a warning.

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

In both cases, you can only provide static header data.

Use from_http to perform HTTP requests or run an HTTP server. This operator automatically tries to infer the format from the Content-Type header. For sending, use save_http with a write operator.

from_http "http://example.com:8888/api?query=tenzir"
from_http "http://example.com:8888/api", method="post", body={query: "tenzir"}
from {
x: 42,
y: "foo",
}
write_json
save_http "http://example.com:8888/api", method="POST"

Last updated: