Retrieve the document from the HTTP response in NodeRed

Working with Node-Red, I'm facing a challenge wherein I need to retrieve a csv file through an API call. Upon making the http request, I received the following response:

{
"_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 query is, how can I proceed to actually download the Report_20180520_0000_20180720_2359.csv? Appreciate any guidance provided.

Answer №1

In the msg.payload, the data files were expected, but upon review of the response, it was found that the file from the server was actually empty.

This is evident as msg.payload is void and msg.headers.content-length is represented as 0

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Access the value of a specific field within an object using ng-options and use it to filter out other

I have created two separate lists. 1) The first list contains the service names. 2) The second list contains the product names assigned to each service name. Each product has a unique ID that matches it with its corresponding service. app.controller( ...

Avoid using the JavaScript 'Sys.WebForms..' function if there is no ScriptManager present on the page

Currently, I am using a single JavaScript binding in the Master Page for my entire project. However, the Master Page does not include a ScriptManager. This means that some pages have Ajax components, such as UpdatePanel, while others do not. The 'Sys. ...

What is the most effective way to extract information from a .txt file and showcase a random line of it using HTML?

As a newbie in HTML, my knowledge is limited to finding a solution in C#. I am attempting to extract each line from a .txt file so that I can randomly display them when a button is clicked. Instead of using a typical submit button, I plan to create a custo ...

What is the reason that Object.keys(window) or for(k in window) does not include the Math object?

As I work on creating a JavaScript editor autocomplete feature, my goal is to showcase all available top-level elements. So far, I've experimented with: Object.keys(window) as well as for (k in window) However, it seems like neither method include ...

What could be the reason for parent props not updating in child components in VueJS?

Hello, I am new to VueJS and encountering an issue. In the main.js file, I am passing the user variable to App.vue using props. Initially, its value is {} The getLoginStatus() method in main.js monitors the firebase authentication status, and when a user ...

Having trouble with the $.post method not loading my PHP file in my

I followed a tutorial on YouTube to copy the code, adjusted the database connection and SELECT items to fit my existing DB, but I'm struggling to get the JS file to load the PHP file. When I use Chrome's "inspect" tool, it shows that the JS file ...

Steps for creating a node.js and ejs file to deploy on 000webhost

I have developed a simple todo-app using node.js and ejs templating. My goal is to host it using 000webhost, a free web-hosting service. I successfully hosted a react app for free on this platform by running "npm run build", which converted the ...

Can a cookie value be an array under the law?

For the longest time, I believed that cookies could only store strings. However, PHP has a unique way of handling cookies that allows you to actually store an array in a cookie without serializing it. You can achieve this by using the following code: setc ...

What is causing the components to not re-render after a state change in React?

I am attempting to retrieve data from the Coin Market Cap API and showcase the details in simple cards. I have experimented with various methods and included comments to document my trials. Any assistance would be greatly appreciated. This is the Parent: ...

Is there a way to verify if an email is already registered within a MERN stack application

I am in the process of creating a registration form and need to verify if an email already exists within the system. Below is the React code snippet showcasing the structure for better understanding. In the schema, emails are defined as unique. AuthContr ...

Is Jquery Mobile's Table lacking responsiveness?

I have implemented a basic table from the jQuery Mobile website on my page. Take a look at the HTML code below: <div data-role="page" id="mainPage"> <div data-role="content> <table data-role="table" id="my-table" da ...

Is it possible to upload a file using Angular and ASP.NET Web API Core?

I am encountering an issue with CORS policy while making requests. It works fine when the content-type is set to 'application/json'. However, when I try to upload a file using content-type 'multipart/form-data', I receive an error: XML ...

Leverage the power of personalized SCSS styles in combination with Bootstrap-Vue, Webpack, and

I have been working on an application using VueJS with Bootstrap-Vue and I encountered a challenge while trying to import a SCSS file to customize the Bootstrap variables and add some custom styles. Here are the steps I have taken so far: Installed node ...

When using jQuery's ajax() function, it is possible to pass HTML as data and change the ampersands in URLs to &amp;

I have encountered an issue where I am capturing the HTML content of a page and attempting to send it as a string to a PHP web service using jQuery's ajax() function. However, when I receive the parameter on the PHP side, the &s in the URLs present wi ...

Increase performance by minimizing unnecessary component re-renders in Next.js using memoization

I am currently exploring the behavior of React within Next.js. I have an index.js page that displays one component Homecard three times and a button that increments a value. Each time I click on the button, all Homecard components are re-rendered. index. ...

Error encountered: iPad3 running on iOS7 has exceeded the localStorage quota, leading to a

Experiencing a puzzling issue that even Google can't seem to solve. I keep getting the QuotaExceededError: DOM Exception 22 on my iPad3 running iOS7.0.4 with Safari 9537.53 (version 7, WebKit 537.51.1). Despite turning off private browsing and trying ...

Cypress - Mastering negative lookaheads in Regular Expressions

While experimenting with Cypress, I encountered an issue regarding a filter test. The goal is to verify that once the filter is removed, the search results should display values that were filtered out earlier. My attempt to achieve this scenario involves ...

Next.js API route is showing an error stating that the body exceeds the 1mb limit

I'm having trouble using FormData on Next.js to upload an image to the server as I keep getting this error. I've tried various solutions but haven't been able to resolve it yet. This is my code: const changeValue = (e) => { if (e.target ...

Row within a table displaying link-like behavior

Here is the code I'm currently using: $('.table-striped tr').click( function() { var link = $(this).find('a').attr('href'); if(link != 'undefined') { window.location = link; } }).hover( func ...

Verifying the operational status of a Facebook Open Graph Entity

When making a call to post an action on an object, how can you determine if a user has already taken that action on the object? If the call is switched to "get" instead of "post", it will retrieve all the user's actions, not just the current object&ap ...