AddCookieToNextRequest with Native rest functions

2
Integrating with SAP Busines One I have to use the REST appstore module because of the requirement to add a sessionid cookie for authentication reasons. I 've got it working with GET and POST.  https://community.mendix.com/link/questions/86193 for more on the REST with cookie topic.  But the appstore module doesn't come with e.g. the PATCH method, which SAPB1 requires me to use for some specific actions. (Updating a child of a recource). 1) Any suggestions to add cookies when using the (7.15.1) native REST functions?  2) Is the "addcookiefornextrequest" issue already on the planning for  next releases?   
asked
2 answers
3

You can add a cookie in a native REST microflow.

Add a HttpResponse as a parameter to the microflow

Add a Create action, and create a System.HttpHeader.

Set the following:

  • Key = 'Cookie'
  • Value = <your value>
  • Associate to the HttpResponse response parameter

 

If you want to add to existing cookies, you have to get the existing cookie header and set value to <existing value>; <your value>

answered
1

Joost, Thanks for the direction but I still get a 401-not authorized.  What did I misunderstand? 
You suggest to add HTTPResponse as a parameter to my microflow, it's an empty object in this case. Then I associated the created header to this response...although I was wondering shouldnt i link the cookie to a request..rather than a response...

 

Edit 27-6: In the end this did the job: Thanks Joost & Austin

answered