Documentation

http.endpoint() 函数

http.endpoint() 遍历输入数据,并对每个输入行向指定的 URL 发送单个 POST 请求。

此函数旨在与 monitor.notify() 一起使用。

http.endpoint() 输出一个需要 mapFn 参数的函数。mapFn 是构建用于生成 POST 请求的记录的函数。它接受一个表格行 (r) 并返回一个必须包括以下属性的记录:

  • headers
  • data

有关属性的信息,请参阅 http.post

函数类型签名
(
    url: string,
) => (mapFn: (r: A) => {B with headers: C, data: bytes}) => (<-tables: stream[A]) => stream[{A with _sent: string}] where C: Record

有关更多信息,请参见 Function type signatures

参数

网址

(必填) 发送POST请求的URL。

示例

对每一行发送一个HTTP POST请求

import "http"
import "sampledata"

endpoint =
    http.endpoint(url: "http://example.com/")(
        mapfn: (r) =>
            ({
                headers: {header1: "example1", header2: "example2"},
                data: bytes(v: "The value is ${r._value}"),
            }),
    )

sampledata.int()
    |> endpoint()


Flux的未来

Flux 正在进入维护模式。您可以像现在一样继续使用它,而无需对您的代码进行任何更改。

阅读更多

InfluxDB 3 开源版本现已公开Alpha测试

InfluxDB 3 Open Source is now available for alpha testing, licensed under MIT or Apache 2 licensing.

我们将发布两个产品作为测试版的一部分。

InfluxDB 3 核心,是我们新的开源产品。 它是一个用于时间序列和事件数据的实时数据引擎。 InfluxDB 3 企业版是建立在核心基础之上的商业版本,增加了历史查询能力、读取副本、高可用性、可扩展性和细粒度安全性。

有关如何开始的更多信息,请查看: