Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
THTTPClient to System.Net.HttpClient.
function DownloadURL(URL: string): TMemoryStream;
var
HTTP: THTTPClient;
begin
Result := TMemoryStream.Create;
HTTP := THTTPClient.Create;
try
try
HTTP.HandleRedirects := True;
HTTP.Get(URL, Result);
except
//Ну, ошибка... Поток всё равно создан и ошибки не должно возникнуть,
//если проверить размер потока перед его использованием
end;
finally
HTTP.Free;
end;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question