Send HTTP request

Is there a way to send an HTTP request using an (pure) Inno program?

isxdl.dll is not an option because it creates a download window.

Also, I would like to avoid using curl.

+6
source share
2 answers

This extension can be downloaded without a user interface; http://www.sherlocksoftware.org/page.php?id=50 (via ITD_DownloadFiles )

+4
source

Use the 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; 
+1
source

Source: https://habr.com/ru/post/886496/


All Articles