Hi all, I’ve build a REST webservice that returns several possible error codes and messages. For this I change the StatusCode and ReasonPhrase attributes of the System.HttpResponse object. When I deploy locally and test this in the Swagger UI page of the service the Error message is shown as expected (namely the content of the ReasonPhrase attribute). However when I deploy exactly the same code on the Mendix cloud the Error message is empty. All the other functions work as expected on the cloud ie. same request gives same response as on local. Anyone any idea what causes this? Local: Cloud:
Martin de Heer
This behavior is caused by the proxy server that is serving the Mendix Cloud. Your application runs fine locally and you see the exact response code and reason phrase that your application has given it.
But when running it in the Mendix cloud, then, on the way back from the application in the cloud to your browser, the error message gets picked up by the proxy-server and transformed back to the standard error message belonging to the statuscode.
This is a pretty old bug so Mendix probably has a reason to not solve. I don’t expect this to change shortly. We are running into this issue at our project as well. Our standards for http-responses can therefor not be used and we are contamplating on how to move forward.