Sample code for 30+ languages & platforms
Node.js

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var http = new chilkat.Http();

    //  Send the HTTP GET and return the content in a StringBuilder
    var sb = new chilkat.StringBuilder();
    success = http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",sb);
    if (http.LastMethodSuccess == false) {
        if (http.LastStatus == 0) {
            //  Communications error.  We did not get a response.
            console.log(http.LastErrorText);
        }
        else {
            console.log("Response status code: " + http.LastStatus);
            console.log("Response body error text:");
            console.log(sb.GetAsString());
        }

        return;
    }

    //  The downloaded content:
    console.log(sb.GetAsString());
    console.log("Success");

}

chilkatExample();