How to set a cookie as a variable to the api request

Hi,

I´m trying to test the API by sending GET and PUT requests.
I´m not opening any browsers in this test case.

The GET Request works properly and I receive the parameters “set-cookie” and “x-csrf-token” in the response header. Now, if I use the parameter values in my PUT request, for authentication, it doesn’t work.

After adding the cookie to the HTTP header of the PUT request I getting 400 BAD REQUEST.
If I don´t add the cookie to the HTTP header of the PUT request I getting 403 FORBIDDEN.

The same requests (body and header) works fine in rest clients like postman.

Http Header GET:

Http Header PUT:

header_put.png

header_get.png

@jonathanT , If you use katalon v 5.8.0. then change Object Repository file to “text” may be it work.

for more info click on : http://forum.katalon.com/discussion/10165/post-api-is-not-working-on-version-5-8-0#latest

Hello jonathan

You can be check in the link : Pass cookie in API

Hi All,
I have a scenario like
1.For login we have an api and for submit otp we have another api. After the submit OTP call, when the dashboard of the application launches, a cookie gets generated. How to fetch this cookie value and give in the header of the rest of API’s .
2.How to fetch this cookie value and store in the global variable and use for other API’s which are dependent to run with the cookie other wise it will fail.

Thanks
Vishal