【问题标题】:Example of accessing Watson IoT Last Event Cache from Node-RED从 Node-RED 访问 Watson IoT Last Event Cache 的示例
【发布时间】:2017-02-08 17:37:26
【问题描述】:

我正在使用来自 HTTP 请求节点的 Watson IoT Last Event Cache 的 REST api。实际事件数据以 Base64 编码返回。我通过 Node-RED Base64 节点运行此程序,但未正确解码。
有没有人有这方面的工作流程?

【问题讨论】:

  • 您能否编辑问题以提供示例,以便我们查看数据的实际情况

标签: node-red watson-iot


【解决方案1】:

Last Event Cache 调用在普通 msg.payload 下的“payload”字段中返回事件数据。 Node.js 可以使用以下方式处理字符串转换:

var s = new Buffer(msg.payload.payload, 'base64').toString('ascii');

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多