In Node-Red, I'm trying to call an API that provides me with a csv file full of data, I make a http request and get the following return:
{
"_msgid": "60d0351dcf215557",
"payload": "",
"topic": "",
"headers": {
"content-length": "0",
"connection": "close",
"content-type": "text/csv",
"date": "Fri, 13 May 2022 07:48:51 GMT",
"server": "Microsoft-IIS/10.0",
"access-control-expose-headers": "Request-Context",
"cache-control": "no-cache",
"expires": "-1",
"pragma": "no-cache",
"request-context": "",
"x-frame-options": "DENY",
"content-disposition": "attachment; filename=Report_20180520_0000_20180720_2359.csv",
"x-node-red-request-node": "3a8a1b06"
},
"statusCode": 200,
"responseUrl": "https://somewebsite.net/api/analytics/report/someID/file",
"redirectList": [],
"retry": 0,
"url": "https://somewebsite.net/api/analytics/report/someID/file"
My question is, how do I actually get to download the Report_20180520_0000_20180720_2359.csv? Thanks for helping out.
CodePudding user response:
The files content would be in the msg.payload
but looking at that response the file returned by the server was empty.
This can be seen by msg.payload
being empty and msg.headers.content-length
being 0