Session Cookies

I need to pull some data from a server. The process is this: 1. POST request a password to a url. 2. recieve session cookiw. 3. use that session cookie in a GET request to another url 4. take the jason object that gives me and store it in firebase. I have the post request working, but can't figure out how to grab the session cookie and use it in the next node. Also the ai node creation function isn't working.
5 Replies
Gaurav Chadha
Gaurav Chadha9mo ago
Hi @richard.roseboom, You'll require to ensure two things to try this out: 1. Ensure that when you make a POST request to the URL it should return cookie. 2. In set the header value to "Set-Cookie" and use this header value for the subsequent API call. 3. Then confirm from the BuildShip could logs headers logs that the headers contains.
Gaurav Chadha
Gaurav Chadha9mo ago
Refer to this example modification of the API call node.
No description
richard.roseboom
Okay I see. thanks. I'll try this out. is this all just node code? or what are the docs / standards to know what responce.headers contains... and what is the way to send headers?
Gaurav Chadha
Gaurav Chadha8mo ago
You can refer to this - https://docs.buildship.com/basics/api-spec. Ways to send header through REST API
richard.roseboom
thanks that seemed to work great!