Which cookie parameter from GET should be passed to POST

Hi ,

I am working on a test case with two webservices. I need to consume a ODATA service to post an order.
When i do the GET method we have two cookie parameters “set-cookie” and “Set-Cookie”. I tried both along with X-CSRF-Token with it. But no use i still get 403 forbidden error.

Can you please help me.

Hi pdevarashetty

For this question, I think it does not related to the tool but on the API requirements.
I think you should check with the developer about the required header, body information in the POST request and extract it from the GET method to use.

So, i figured out that i need to pass Set-Cookie from GET request and pass it to Cookie parameter in POST Request. But it works fine if i do it manually but when i pass it from the Global Variable in my test case then it gives me back same error 403 Forbidden.
So to test it i manually copied that cookie from GET request and passed it to to POST Request then i see an error as below:
java.lang.IllegalArgumentException: Illegal character(s) in message header value:

Over all i see that when the value is passed from the Global Variable then something is missing.

Any help would be appreciated.

Ok, In case someone end up in the same situation this is how i SOLVED IT.
The GET method returns CSRF token and set-cookie with ‘[’ and ‘]’ which is directly passed to POST method CSRF token and Cookie.
I just replaced those two square braces with ’ ’ and it worked fine.
thank you for the reply sang.

Okay pdevarashetty, good to hear that it works. Thank you for your information as well.