Sample code for 30+ languages & platforms
Visual FoxPro

Send HTTPS Get Without Waiting for the Response

See more REST Examples

This example demonstrates sending an HTTP GET request without waiting for the response.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loRest
LOCAL lnBAutoReconnect
LOCAL lnMaxWaitMs

lnSuccess = 0

* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

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