.csv file being downloaded as html in Delphi

0
Hello, I have an application in delphi 6 that takes a central white api, to download a .csv file, put it inside a document and show it in a memo. But the download is coming as html and presenting in a bizarre way. They said that is some parameter of the component IdHTTP1. Excerpt of the code that shows the contents of the api at the click of a button:

procedure TForm1.Button2Click(Sender: TObject);
var
  teste : TFileStream;
begin
  teste := TFileStream.Create('C:\cotacao181128.csv', fmCreate);
  IdHTTP1.Get('https://www4.bcb.gov.br/Download/fechamento/20181128.csv', 
teste);
  freeandnil(teste);
  Memo1.Lines.LoadFromFile('C:\cotacao181128.csv');

end;
    
asked by anonymous 28.11.2018 / 19:45

0 answers