Set Cookies for Http Request

I am trying to use Http Request post to our SAP OData service.

Currently I set Cookie as name , value get from previously step, format like “sap-usercontext=sap-client=200; path=/,MYSAPSSO2=AjQxMDMBABhUAFYAQwAtAEUAVgBFAFIATABPAFUAIAACAAYyADAAMAADABBUAFcARAAgACAAIAAgACAABAAYMgAwADIAMQAwADYAMQA2ADEAMwA1ADkABQAEAAAACAYAAlgACQACRQD%2fAPswgfgGCSqGSIb3DQEHAqCB6jCB5wIBATELMAkGBSsOAwIaBQAwCwYJKoZIhvcNAQcBMYHHMIHEAgEBMBkwDjEMMAoGA1UEAxMDUzAxAgcgFAMIIRABMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMTA2MTYxMzU5NDlaMCMGCSqGSIb3DQEJBDEWBBSM2NNG9PRXLF1eyt%2fN1c0ulw0QajAJBgcqhkjOOAQDBC8wLQIUXP%21jxm8dS3WH5z5vZUe2wbz5hokCFQCdnIgKXaHgCfyPBrFytSozUGmeMg%3d%3d; path=/; domain=.testcom,SAP_SESSIONID_TWD_200=58daAmAVzQCLE8cdjDHi6x2j3m3OqxHri6lCAQrwvFA%3d; path=/”

after the Http Request call, the status code is 0 and result is blank.

From following post:

I understand that the cookie need to be set as per individual cookie name.

Now the issue is the cookie name is dynamic returned from previously step.

In Http Request Cookie, I cannot set a dynamic name.

Please help.

Thanks.

Found a solution is hard code all possible cookie name in the Cookies setting.
like following:
SAP_SESSIONID_TWD_200
SAP_SESSIONID_TWD_300
SAP_SESSIONID_TWD_400

Can work but not perfect…

@slashgao Bro. Simple solution is to use Cookies section of http request as you have given but you can’t use Set-Cookie directly from Header response.

Make API call in postman and there you can see name and value of each cookie under Cookies tab of response. You need to send the cookies separately like that in UiPath. You can perform string manipulation on Set-Cookie and get values of each cookie. It will work.

If it helps, mark it as solution. Thanks bro.

@Ranga_Ravi like I mentioned, I am able to get the value of each cookie.

The issue now is the cookie name is different per different system which not able set as a variable in httpclient cookies.

I hope this clarifies.