本文整理自网络,侵删。
{"Result":"OK","Records":[{"id":504},{"id":505},{"id":534},{"id":535},{"id":536}]}
procedure TForm1.WebHttpRequest1Response(Sender: TObject; AResponse: string);var js: TJSON; ja: TJSONArray; jo: TJSONObject; i: integer;begin jo := js.Parse(AResponse);
ja := TJSONArray(jo.GetValue('Records'));
ShowMessage('Retrieved items:' +inttostr(ja.Count));
for i := 0 to ja.Count - 1 do begin jo := ja.Items[i]; WebListBox1.Items.Add(jo.GetJSONValue('id')); end; finally js.Free; end; end;
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>