Hi there, I have two questions:
- An error message is shown "[Error] RequestorUnit.pas(237): identifier not found "TJSJSON"
when I try to run the code "Result := TVerifyResponse(TJSJSON.parse(req.responseText));", why?
2.The type of TJSXMLHttpRequest.response is JSValue and the value is {"errorCode": 0}.The code below:
type
TVerifyResponse = record
errorCode: Integer;
end;
......
var
req: TJSXMLHttpRequest;
vr: TVerifyResponse;
begin
...
try
req:=await(TJSXMLHttpRequest, WebHTTPRequest1.perform);
expcept
.....
end;
vr:=TVerifyResponse(req.response);
console.log(vr);
end;
The code runs failed, an error message is in console:
Uncaught (in promise) TypeError: Cannot read property 'errorCode' of null
at Object.$assign (RequestorUnit.pas:62)
at Object.DoVerify (RequestorUnit.pas:237)
Any idea about this??
Source code is here:RequestorUnit.pas (6.4 KB)
Thanks.