Send HTTP Request

大兔子大兔子 提交于 2019-12-19 07:17:09

问题


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.


回答1:


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




回答2:


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;


来源:https://stackoverflow.com/questions/5758403/send-http-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!