Sample code for 30+ languages & platforms
Visual FoxPro Requires Chilkat v11.0.0+

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL loResp
LOCAL loJson

lnSuccess = 0

loHttp = CreateObject('Chilkat.Http')
loResp = CreateObject('Chilkat.HttpResponse')

*  Only allow TLS 1.2 or better.
loHttp.SslProtocol = "TLS 1.2 or higher"

lnSuccess = loHttp.HttpNoBody("GET","https://google.com/",loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loResp
    CANCEL
ENDIF

loJson = CreateObject('Chilkat.JsonObject')
loJson.EmitCompact = 0

loHttp.GetLastJsonData(loJson)
? loJson.Emit()

*  Output as of Chilkat v11.1.0
*  Additional information may be added as requested or needed in future versions of Chilkat.

*  {
*    "tls": {
*      "params": {
*        "sniHostname": "www.google.com",
*        "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher"
*      },
*      "negotiatedTlsVersion": "TLS 1.3"
*    }
*  }

RELEASE loHttp
RELEASE loResp
RELEASE loJson