(AutoIt) Send HTTPS Get Without Waiting for the Response
This example demonstrates sending an HTTP GET request without waiting for the response.
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oRest = ObjCreate("Chilkat.Rest")
; Connect to the server using TLS
Local $bAutoReconnect = False
Local $bSuccess = $oRest.Connect("example.com",443,True,$bAutoReconnect)
If ($bSuccess = False) Then
ConsoleWrite($oRest.LastErrorText & @CRLF)
Exit
EndIf
; Send a GET request to https://example.com/some/path
$bSuccess = $oRest.SendReqNoBody("GET","/some/path")
If ($bSuccess = False) Then
ConsoleWrite($oRest.LastErrorText & @CRLF)
Exit
EndIf
; OK, the request was sent.
; Close the connection.
Local $iMaxWaitMs = 50
$oRest.Disconnect($iMaxWaitMs)
ConsoleWrite("GET Request Sent." & @CRLF)
|