Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send HTTP Request

Is there any way to send HTTP request using (pure) Inno Setup?

isxdl.dll isn't an option, because it creates window of the "download".

Also I would like to avoid using curl.

like image 600
mnn Avatar asked Apr 22 '11 17:04

mnn


2 Answers

This extension can download without a UI; http://www.sherlocksoftware.org/page.php?id=50 (Via ITD_DownloadFiles)

like image 187
Alex K. Avatar answered Sep 28 '22 00:09

Alex K.


Use WinHttpRequest object:

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(Format('HTTP error: %d %s', [Integer(WinHttpReq.Status), WinHttpReq.StatusText]));
  end
    else
  begin
    Log(Format('HTTP Response: %s', [WinHttpReq.ResponseText]));
  end;
end;
like image 27
Martin Prikryl Avatar answered Sep 28 '22 00:09

Martin Prikryl