What’s the simplest way to call Http GET url using Delphi?

Calling a RESTful web service using Indy is pretty straight forward.

Add IdHTTP to your uses clause. Remember that IdHTTP needs the “HTTP://” prefix on your URLs.

function GetURLAsString(const aURL: string): string;
var
  lHTTP: TIdHTTP;
begin
  lHTTP := TIdHTTP.Create;
  try
    Result := lHTTP.Get(aURL);
  finally
    lHTTP.Free;
  end;
end;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)