Code that worked using RTC 7.15 is not working after upgrade to 8.25
POST JSON Body:
{"idOrder" : 402317,"idProduct" : 5138154,"Packages" : [],"GeoLocation" : "PA-Blakeslee","GeoPrinterDrum" : "GP-C831","GeoPrinterBottle" : "EPSON-ET-4550","PrintMode" : ""}
Code in onDataReceived(Sender: TRtcConnection):
PayLoad := Srv.Read;
LogMessage := LogMessage + #13#10#09 + 'PayLoad: ' + PayLoad;
Log(LogMessage, '');
if (PayLoad.IsEmpty) then begin
message := 'Request must containe JSON Body';
break;
end;
Try
JSONPayload := TRtcRecord.FromJSON(PayLoad);
Except
on E : Exception do begin
message := 'Invalid JSON request data: ' + E.Message;
break;
end;
End;
// Now have valid JSon from Body of POST
if (JSONPayload.CheckType('idOrder', rtc_Integer[) = false) then begin // should return true, but returns false
if (JSONPayload.CheckType('LOT', rtc_Integer) = false) then begin
message := 'value for idOrder or LOT must be supplied';
break;
end;
LOT := JSONPayload.asInteger['LOT'];
idOrder := 0;
end else begin
idOrder := JSONPayload.asInteger['idOrder'];
LOT := 0;
if (JSONPayload.CheckType('idOrder', rtc_Integer) should return true but it is returning false.
if I do JSONPayload.asInteger['idOrder'] in watch list it correctly shows 402317.
this same CheckType code works on another computer running RTC 8.15.
Not sure why?
Thanks for any help.