You are not logged in.
Hi,
I'm kind of irritated already, that TRestServerUriContext decides to change my returned content as per default, when I have an error code, however, it really bugs me, that when using ReturnsJson, that there is no option, to suppress that behavior. Why would that be. We have established a pretty specific communication protocol within our system, to send data, states, etc.
Yes, we can convert to JSON every time manually and use Returns with HandleErrorAsRegularResult set to true, but why is it designed to force one to do it that way? Shouldn't the lib, as per standard, treat content returned as-is, rather than changing it in some circumstances?
Would it at least make sense, having an overloaded version of ReturnsJson with the HandleErrorAsRegularResult parameter available?
Regards,
Daniel
Offline
Fair enough.
I have added the HandleErrorAsRegularResult: boolean optional parameter to ReturnsJson().
Check https://github.com/synopse/mORMot2/comm … 3b61ff428f
Offline