Sample code for 30+ languages & platforms
Perl

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $http = Chilkat2::Http->new;

# Send the HTTP GET and return the content in a StringBuilder
my $sb = Chilkat2::StringBuilder->new;
my $success = $http->QuickGetSb('https://www.chilkatsoft.com/helloWorld.json', $sb);
if (!$http->LastMethodSuccess) {
    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";