minimal example TWebHttpRequest

Lazarus and debian

I need a minimal example of using TWebHttpRequest.

this example failed

procedure TForm1.WebButton2Click(Sender: TObject);
begin
WebHttpRequest1.URL := 'https://download.tmssoftware.com/tmsweb/fishfacti.json';
WebHttpRequest1.Execute;
end;

procedure TForm1.WebHttpRequest1RequestResponse(Sender: TObject;
ARequest: TJSXMLHttpRequestRecord; AResponse: string);
begin
WebMemo1.Lines.Clear;
WebMemo1.lines.Add(AResponse);
end;

The problem is solved with the use of TWebClientConnection

procedure TForm1.WebButton2Click(Sender: TObject);
begin
WebClientConnection1.URI := 'https://download.tmssoftware.com/tmsweb/fishfacti.json';
WebClientConnection1.Active := true;

end;

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.