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