问题描述
我可以使用 Node-RED 通过此查询检索数据,但需要使用 R 检索它。
这是我得到的。
post.1 <- httr::POST(url=paste0("http://",influx.ip,":8086/api/v2/signin"),authenticate(influx.user,influx.passwd))
# Authentication seems to work.
influx.query <- 'from(bucket: "nr_meas")
|> range(start: -12h)'
post.2 <- httr::POST(url=paste0("http://",":8086/api/v2/query"),query=list(org=influx.org),add_headers("Content-Type: application/json",'Accept: application/csv'),body=list(q=influx.query)
)
content(post.2)
# $code
# [1] "invalid"
#
# $message
# [1] "Failed to decode request body: invalid character '-' in numeric literal"
从 Node-RED 保存不是一个选项(在不同的计算机上)。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)