Http post reguest login and then download file

I'm trying to download a csv file from a website with the http request node where the download is behind a login.
After a lot of trying, reading the forum and much googling it's now possible to login with a http request in the website.Thanks to Steve-Mcl his tip to use the Network tab in the inspector of chrome. Right click on the POST request and you can copy the POST as Node.js fetch. Some minor changes to this Node.js and you can past it in a function node.

My problem is now that if I want to download the file with a second http request node after a successful login with the first http request node apparently the website has already logged me out again and can't download the file and will be redirected to the login page again. Tried off course checking the Enable connection keep-alive checkbox, but with no result.

Any idea where to look at or any other tip to get me going again.

This is how the flow flows :wink:

(probably) It's not that you're logged out, it's more that the login typically returns a token or header or cookie that you must include in the next request.

You should see that in the network request when you download the csv (or any other secured endpoint)

So once you find what that is, store it (keep it in the msg or store in context) then add it into the message header/cookie in the 2nd request.

Note, I cannot be more specific as I don't know the URL or platform or security measures of the "thing" you are trying to access.

Thanks Steve for your reply.
I will investigate to see if and what for cookies or token they are using. Is all new for me so it will take some time to find it all out.
Can' t share the flow and/or the website with the community, the cvs download is not for nothing behind a login.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.