I am trying to download a file to a string:
function FetchUrl(const url: string): string;
var
idhttp : TIdHTTP;
begin
idhttp := TIdHTTP.Create(nil);
try
Result := idhttp.Get(url);
finally
idhttp.Free;
end;
end;
What is wrong with this code? I get an exception: HTTP/1.1 302 Found
Set the
TIdHTTP.HandleRedirectsproperty to True. It is False by default.