Сделать GET запрос.

function HttpGet(const url: string): string;
var
    idHTTP : TidHTTP;
    Stream : TStringStream;
begin
  result := EmptyStr;
  idHTTP:=TidHTTP.Create;
  Try
    idHTTP.AllowCookies:=True;
    idHTTP.HandleRedirects:=True;

    idHTTP.ProxyParams.Clear;
    if FNeedProxy then
    begin
      idHTTP.ProxyParams.ProxyPort           := FProxyPort;
      idHTTP.ProxyParams.ProxyServer         := FProxyServer;
      idHTTP.ProxyParams.ProxyUsername       := FProxyLogin;
      idHTTP.ProxyParams.ProxyPassword       := FProxyPassword;
      idHTTP.ProxyParams.BasicAuthentication := True;
    end;

    Stream := TStringStream.Create;
    try
      idHTTP.Get(url, Stream);
      Stream.Position := 0;
      Result := Stream.DataString;
    finally
      Stream.Free;
    end;
  finally
    idHTTP.Free;
  end;
end;
Метки: