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

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL oResp
LOCAL oJson

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")
oResp := CreateObject("Chilkat.HttpResponse")

//  Only allow TLS 1.2 or better.
oHttp:SslProtocol := "TLS 1.2 or higher"

nSuccess := oHttp:HttpNoBody("GET", "https://google.com/", oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp:destroy()
    RETURN
ENDIF

oJson := CreateObject("Chilkat.JsonObject")
oJson:EmitCompact := 0

oHttp:GetLastJsonData(oJson)
? oJson: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"
//    }
//  }

oHttp:destroy()
oResp:destroy()
oJson:destroy()