You are not logged in.
Pages: 1
How would I set a custom status code on mormot?
I want, inside my services, to be able to set a custom http status code (say 500)
If possible, it would be nice to add a property to TServiceCustomAnswer for setting the status code, now you can set headers and body, but it would be nice to set the status code as well.
Regards...
Last edited by jvillasantegomez (2013-12-20 21:16:10)
Offline
By now, it expects HTML_SUCCESS (200) on the client side for any success full process.
See e.g. TServiceFactoryClient.InternalInvoke().
So allowing any custom code may be very difficult, and break the default expected behavior of the JSON-RPC protocol.
Note that if you raise an exception, it will return an error 500 to the client.
Perhaps you may consider using a method-based service instead (see the SAD 1.18 pdf), which will give you access to all call parameters, including HTTP status code.
See http://blog.synopse.info/post/2010/07/1 … phi-7-2010
Offline
Pages: 1