首页 > 解决方案 > Node-Red HTTP 请求节点在文件下载时抛出 1020 错误

问题描述

我正在尝试通过 node-red 下载一个大型 JSON 文件,它会引发“错误 1020”。当我在 HTTP 节点中说“解析 JSON”时,它会说解析器错误。但是,使用 Python 或 Java 解析正在下载的数组可以正常工作。当我下载为 UTF-8 字符串时,我收到错误 1020。

这是流程:

[{"id":"e0e091b8.2b78a","type":"http request","z":"95f2458b.b4a148","name":"Downloader","method":"GET","ret":"txt","paytoqs":false,"url":"https://JSONURLHERE","tls":"","persist":false,"proxy":"","authType":"","x":450,"y":300,"wires":[["53175134.cd5c9"]]},{"id":"1b838110.b3d76f","type":"inject","z":"95f2458b.b4a148","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":380,"wires":[["c4816b73.f2bfe8"]]},{"id":"c4816b73.f2bfe8","type":"function","z":"95f2458b.b4a148","name":"","func":"msg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\n\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":280,"wires":[["e0e091b8.2b78a"]]},{"id":"53175134.cd5c9","type":"debug","z":"95f2458b.b4a148","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":640,"y":320,"wires":[]}]

标签: node-red

解决方案


推荐阅读