hello SUPPORT, can you help me to adapt/read this kind of response JSON
thanks in advance.
procedure TForm1.WebHttpRequest1Response(Sender: TObject; AResponse: string);
var
js: TJSON;
ja: TJSONArray;
jo: TJSONObject;
i: integer;
begin
js := TJSON.Create;
try
ja := TJSONArray(js.Parse(AResponse));
ShowMessage('Retrieved items:' +inttostr(ja.Count));
for i := 0 to ja.Count - 1 do
begin
jo := ja.Items;
WebListBox1.Items.Add(jo.GetJSONValue('id'));
end;
finally
js.Free;
end;
end;
Because i got this console error:
Uncaught TypeError: ja.GetCount is not a function
at Object.WebHttpRequest1Response (Unit1.pas:49)
at Object.cb [as FOnResponse] (rtl.js:205)
at Object.HandleResponse (WEBLib.REST.pas:278)
at XMLHttpRequest.cb (rtl.js:205)