Sample code for 30+ languages & platforms
Node.js

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var http = new chilkat.Http();
    var resp = new chilkat.HttpResponse();

    //  Only allow TLS 1.2 or better.
    http.SslProtocol = "TLS 1.2 or higher";

    success = http.HttpNoBody("GET","https://google.com/",resp);
    if (success == false) {
        console.log(http.LastErrorText);
        return;
    }

    var json = new chilkat.JsonObject();
    json.EmitCompact = false;

    http.GetLastJsonData(json);
    console.log(json.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"
    //    }
    //  }

}

chilkatExample();