Sample code for 30+ languages & platforms
PHP ActiveX

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

$http = new COM("Chilkat.Http");

// Send the HTTP GET and return the content in a StringBuilder
$sb = new COM("Chilkat.StringBuilder");
$success = $http->QuickGetSb('https://www.chilkatsoft.com/helloWorld.json',$sb);
if ($http->LastMethodSuccess == 0) {
    if ($http->LastStatus == 0) {
        // Communications error.  We did not get a response.
        print $http->LastErrorText . "\n";
    }
    else {
        print 'Response status code: ' . $http->LastStatus . "\n";
        print 'Response body error text:' . "\n";
        print $sb->getAsString() . "\n";
    }

    exit;
}

// The downloaded content:
print $sb->getAsString() . "\n";
print 'Success' . "\n";

?>