You are not logged in.
Hello there everyone,
I need a little clarification concerning the way the mORMot framework returns the standard REST codes e.g 200, 202 , 204, 404 etc.
I want to look for these codes in the messages received from my mORMot server by the RESTful clients of my application (Java & Lazarus/FPC) and display appropriate messages to the users.
How do I implement this functionality in my mORMot server and where do I look for the codes in the messages sent by the server to my clients?
Thanks a lot for your kind assistance.
JD
Offline
Please check the documentation.
Method-based services handle any kind of return code, as you want.
https://synopse.info/files/html/Synopse … #TITLE_349
Interface-based services are usually abstracted from REST/HTTP codes.
They may called outside of the HTTP/REST protocol, e.g. directly in-process on server side.
So you should better not rely on HTTP/REST codes with interface based services.
Check https://synopse.info/files/html/Synopse … l#TITL_165
TL&LR: do not rely on HTTP codes, but return 200 on normal status, and an error code as integer enumeration, optionally with a textual/English error message.
Offline