【问题标题】:Want to access wins data in JSON body , can`t find the right path to the result?想要访问 JSON 正文中的 wins 数据,找不到正确的结果路径?
【发布时间】:2021-10-11 08:01:28
【问题描述】:

我正在为我的 Chainlink 节点开发这个外部适配器。我从 RapidAPI 调用基于名称字段的 POST API 调用。这是返回的正文。

在 node.js 中,我想在“data”数组中检索“wins”:

>     Requester.request(options, customError)
>         .then(response => {
>          
>           response.data.result = Requester.validateResultNumber(response.data,['data', 'performance','wins'])
>           callback(response.status, Requester.success(jobRunID, response))
>         })

但我得到了:

AdapterError: TypeError: Cannot read property 'wins' of undefined

我需要写什么路径才能得到我的结果?

【问题讨论】:

    标签: node.js json curl post chainlink


    【解决方案1】:

    找到了路径:["data", "0", "performance", "wins"]。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-27
      • 1970-01-01
      • 1970-01-01
      • 2014-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-02
      相关资源
      最近更新 更多