Hi all

I have a request to integrate with a Java web service by doing a POST to a URL with certain parameters. The web service was developed to be called from a browser rather than a server, so makes use of certain cookies to work (namely, the JSESSIONID cookie). 

Upon the first request I get the correct cookies and values on the set-cookie header, however I have not been able to send the values back when doing a POST. I have tried adding a header with the name JSESSION id, and including this value on the call and tries setting a header with the name "cookies" and sent the cookie values (as JESSIONID=12DFG23; OtherCookie=123) with no luck.


Any idea what I am doing wrong?


Regards,

   CLSJ

Hi Carlos,

Have you taken a look at the HTTPRequestHandler Exension? It has both GetCookie and SetCookie Actions you might use.

Hey Killian


Yes, I've set the cookies and I am able to see them both in the chrome inspect console and if I do a GetCookie, however (I suspect) since the request is coming from the server rather than directly from the browser the cookies are not being sent, thus I need to specify them directly


Regards,

   CLSJ

Hi Carlos,

Quoting João Rosado in this post:

You have 2 ways of adding cookies: either just adding a header called "cookies" to your request or going in OnBeforeRequestAdvanced and add it in C#/Java on the request.

Hi Joao


Yeah I saw that. The cookie header did not work. I also tried the REST Extender xif but keep getting cast errors. I'll do a deep dive into the C# option and let you know how it went


Carlos López Santibáñez Jácome wrote:

Hi Joao


Yeah I saw that. The cookie header did not work. I also tried the REST Extender xif but keep getting cast errors. I'll do a deep dive into the C# option and let you know how it went


Hi Carlos, can you perhaps start a support thread on the REST Extender component and I can try and assist

Hanno