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:
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.
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.
Examples
Section titled “Examples”Perform a GET request with URL parameters
Section titled “Perform a GET request with URL parameters”from_http "http://example.com:8888/api?query=tenzir"Perform a POST request with JSON body
Section titled “Perform a POST request with JSON body”from_http "http://example.com:8888/api", method="post", body={query: "tenzir"}Call a webhook API with pipeline data
Section titled “Call a webhook API with pipeline data”from { x: 42, y: "foo",}write_jsonsave_http "http://example.com:8888/api", method="POST"