How can i get and set cookie parameter in REST Message?

Rimi
Kilo Contributor

How can i get and set cookie parameter in REST Message? i have tried to use getCookies(), setCookies(), getHeader() but not able to get response properly... on trying getHeader("set-cookie") it gives the complete header value and i am not able to set it.

13 REPLIES 13

imujjwalsingh
Tera Contributor

Hi Rimi,



Did you get the solution for this?


I also need this for one of my integration.



Thanks,


Ujjwal


rimi or anyone..



I am facing the same issue.Any solution to this?



Warm regards


Milap


Here is a code sample I am using to extract a session cookie and send it to the next request. Two things to keep in mind:


1) incoming session cookie comes (in the login request) in a "Set-Cookie" header


2) outgoing session cookie must be sent in a "Cookie" header


In my case, Web Request returns a JSESSIONID session cookie


So... in the login request:


ishtein
Mega Contributor

find_real_file.png


Apologies for multiple posts, but after unsuccessful attempts to paste a code sample simply pasted a screenshot... hope this will help someone...