The URL I use are open fine in the browser but, it don,t work with synapse!
Can You provide me with the right code for downloading an URL with the function I've got!
There was to missing end; in the code but they are there now.
Uses http;
function DownloadUrl(const AUrl: string): string;
var ss: TStringStream;
begin
ss := TStringStream.Create('');
try
if HttpGetBinary(AUrl, ss) then
begin
ss.Seek(0, soBeginning);
result := ss.DataString;
end
else
result := 'Failed to download URL';
finally
ss.Free;
end;
and the URl should be?
DownloadUrl code code