You are not logged in.
I have a simple method, like:
IServerMethods = interface(IInvokable)
function MyMethod(const data: string): TServiceCustomAnswer;
end;
The method implementation is like:
try
SomeMethod();
except
Result.Content := 'server error';
Result.Status := HTML_SERVERERROR;
end;
When I use it with a TSQLHttpClient the Status value does not return to the client, the Content and Header is OK, but the Status isn't initialized.
I was expecting that the Status would be returned to the client, so I could use it like:
Response := DoRequest;
if Response.Status = HTML_SERVERERROR then
....
Is the Status not expected to be filled on the client? I think it makes sense for it to get to the client, looks like a bug to me.
Offline
If Status is not HTML_SUCCESS (200), then TSQLHttpClient would handle it as an error, and won't execute the method.
Only case where Status is to be used is when you have a non TSQLHttpClient as client (e.g. an AJAX client).
If you want to transmit some data to the TSQLHttpClient instance, you need to include this information into the transmitted binary content.
Offline