5

Could some one tell me how can I get www content in Pascal Code in Inno Setup Script?

Regards,
Tomasz

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Tomasz Filipek
  • 579
  • 1
  • 6
  • 17

1 Answers1

4

Use WinHttpRequest class:

var
  WinHttpReq: Variant;
begin
  WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
  WinHttpReq.Open('GET', 'https://www.example.com/', False);
  WinHttpReq.Send('');
  if WinHttpReq.Status <> 200 then
  begin
    Log('HTTP Error: ' + IntToStr(WinHttpReq.Status) + ' ' +
        WinHttpReq.StatusText);
  end
    else
  begin
    Log('HTTP Response: ' + WinHttpReq.ResponseText);
  end;
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992