I have a server method "CustomerLookup" that accept a string parameter "CompanyName", user may enter any characters and CustomerLookup method will return a list of customers that partially match the criteria. My REST URL is something like below, the final word "t" is the method's parameter
http://localhost/datasnap/rest/TSales_SM/CustomerLookup/t
My expected outcome is if user enter "t", method will return all customers' companyname that partially match "t". But i found out for certain character like T & Y will convert to True, N & F will convert to false. The converting code is implemented in delphi unit -> DataSnap.DSService
procedure TDSRESTService.BuildParamArray(const Params: TStringList; var ParamArray: TJSONArray);
var
I: Integer;
S: String;
LValue: Double;
begin
ParamArray := TJSONArray.Create;
for I := 0 to Params.Count - 1 do
begin
S := Params[I];
if (AnsiIndexText(S,TrueBoolStrs) > -1) then
ParamArray.AddElement(TJSONTrue.Create)
else if AnsiIndexText(S,FalseBoolStrs) > -1 then
ParamArray.AddElement(TJSONFalse.Create)
else if AnsiCompareStr(S,NULL) = 0 then
ParamArray.AddElement(TJSONNull.Create)
else
if TDBXPlatform.TryJsonToFloat(S, LValue) then
ParamArray.AddElement(TJSONNumber.Create(S))
else
ParamArray.AddElement(TJSONString.Create(S));
end;
end;
Can anyone tell me how to prevent system to convert of T, F, Y, N to true and false
Thanks.