(Visual FoxPro) Send HTTPS Get Without Waiting for the Response
This example demonstrates sending an HTTP GET request without waiting for the response.
LOCAL loRest
LOCAL lnBAutoReconnect
LOCAL lnSuccess
LOCAL lnMaxWaitMs
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Rest')
loRest = CreateObject('Chilkat.Rest')
* Connect to the server using TLS
lnBAutoReconnect = 0
lnSuccess = loRest.Connect("example.com",443,1,lnBAutoReconnect)
IF (lnSuccess = 0) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
* Send a GET request to https://example.com/some/path
lnSuccess = loRest.SendReqNoBody("GET","/some/path")
IF (lnSuccess = 0) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
* OK, the request was sent.
* Close the connection.
lnMaxWaitMs = 50
loRest.Disconnect(lnMaxWaitMs)
? "GET Request Sent."
RELEASE loRest
|