docs-v2/content/flux/v0.x/stdlib/http/endpoint.md

1.3 KiB

title description aliases menu weight flux/v0.x/tags introduced
http.endpoint() function The `http.endpoint()` function sends output data to an HTTP URL using the POST request method.
/influxdb/v2.0/reference/flux/functions/http/endpoint/
/influxdb/v2.0/reference/flux/stdlib/http/endpoint/
/influxdb/cloud/reference/flux/stdlib/http/endpoint/
flux_0_x_ref
name parent
http.endpoint http
202
notification endpoints
0.39.0

The http.endpoint() function sends output data to an HTTP URL using the POST request method.

import "http"

http.endpoint(
    url: "http://localhost:1234/"
)

Parameters

url

The URL to POST to.

mapFn

A function that builds the record used to generate the POST request.

{{% note %}} You should rarely need to override the default mapFn parameter. To see the default mapFn value or for insight into possible overrides, view the http.endpoint() source code. {{% /note %}}

mapFn accepts a table row (r) and returns a record that must include the following fields:

  • headers
  • data

For more information, see http.post()