Skip to content

HTTP

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.

Examples

Perform a GET request with URL parameters

from "http://example.com:8888/api", method="GET", params={query: "tenzir"}

Perform a POST request with JSON body

from "http://example.com:8888/api", method="POST", data={query: "tenzir"}

Call a webhook API with pipeline data

from {
x: 42,
y: "foo",
}
to "http://example.com:8888/api"