How to use Groovy to set Status, Content-Length, Content-Type in the HTTP Response for a MockService
I promise I have genuinely tried and failed to find an answer both here and over on StackOverflow. I've seen a number of variants on my question but nothing where the answer is as simple as mockResponse.setHeader(Content-Length, 0)
So I want to set various HTTP Response header fields in the Script of my MockService Response script.
The dialog tells me that I've got a number of variables available to me including log, mockRequest, mockResponse.
I've worked out the simple HelloWorld equivalent
log.info "Hello from my script"
I made a guess that for log that the methods would be info, warn etc.
But how do I use mockResponse to set some HTTP Header's in particular as mentioned in the question Content-Length and Status. I tried to find a reference for the methods but failed.