PHP Extension
PHP Extension
Example: Http.QuickGetSb method
Demonstrates theQuickGetSb method.
Chilkat PHP Extension Downloads
<?php
include("chilkat.php");
$success = false;
$http = new CkHttp();
// Send the HTTP GET and return the content in a StringBuilder
$sb = new CkStringBuilder();
$success = $http->QuickGetSb('https://www.chilkatsoft.com/helloWorld.json',$sb);
if ($http->get_LastMethodSuccess() == false) {
if ($http->get_LastStatus() == 0) {
// Communications error. We did not get a response.
print $http->lastErrorText() . "\n";
}
else {
print 'Response status code: ' . $http->get_LastStatus() . "\n";
print 'Response body error text:' . "\n";
print $sb->getAsString() . "\n";
}
exit;
}
// The downloaded content:
print $sb->getAsString() . "\n";
print 'Success' . "\n";
?>