You can have both httpRequest and httpResponse objects as (additional) input parameters to your published microflow. Mendix will use them automatically, you won’t have to map them or anything. Then in the microflow just set your httpResponse object as you wish. No need to return it though, just set it. Note that Mendix seems to have deprecated setting the ReasonPhrase explicitly, it will overwrite it and do that automatically based on the StatusCode, which makes sense. I don’t remember precisely when that’s going to happen though, probably Mx10.
Thank you for your reply and your help. I made a small setup in Mx10 to see if I understood your answer.
However in this setup the microflow still returns a httpresponse ‘200’ / ‘Succesfull operation’, instead of the httpresonse ‘401’ / 'Authorization failed: connection rejected' I created. What would be your advise to change this microflow to make it return the right httpresponse?
Thank you again for your help and have a nice day!
Inspired by the response of Martin I did another test today. It seems that you don’t need to create a new HttpResponse object like I did, but just change the existing one. In hindsight this seems logical. Now the REST Service returns the right status, so case closed!