Tenzij er een boel veranderd is in Indy (en dat is vaak zo) controleer je normaal gesproken op de responsecode, deze is 200 als het gelukt is.
Delphi Code:
procedure TfrmMain.btnGetClick(Sender: TObject);
var
S: string;
begin
try
S := HTTP.Get(edtURL.Text);
if HTTP.ResponseCode = 200 then
mmoResult.Text := S
else
mmoResult.Text := Format('Errorcode: %d, message: "%s"',
[HTTP.ResponseCode, HTTP.ResponseText]);
except
on E: Exception do
mmoResult.Text := Format('Exception: "%s"',
[E.Message]);
end;
end;
Bookmarks