Sample code for 30+ languages & platforms
Xbase++

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 Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oRest
LOCAL nBAutoReconnect
LOCAL nMaxWaitMs

nSuccess := 0

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

oRest := CreateObject("Chilkat.Rest")

//  Connect to the server using TLS
nBAutoReconnect := 0
nSuccess := oRest:Connect("example.com", 443, 1, nBAutoReconnect)
IF (nSuccess == 0)
    ? oRest:LastErrorText
    oRest:destroy()
    RETURN
ENDIF

//  Send a GET request to https://example.com/some/path 
nSuccess := oRest:SendReqNoBody("GET", "/some/path")
IF (nSuccess == 0)
    ? oRest:LastErrorText
    oRest:destroy()
    RETURN
ENDIF

//  OK, the request was sent.
//  Close the connection.
nMaxWaitMs := 50
oRest:Disconnect(nMaxWaitMs)

? "GET Request Sent."

oRest:destroy()