Perl Requires Chilkat v11.0.0+
Chilkat2 Perl
Example: Http.GetLastJsonData method
Demonstrates theGetLastJsonData method.
Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
my $http = Chilkat2::Http->new;
my $resp = Chilkat2::HttpResponse->new;
# Only allow TLS 1.2 or better.
$http->SslProtocol('TLS 1.2 or higher');
my $success = $http->HttpNoBody('GET', 'https://google.com/', $resp);
if (!$success) {
print $http->LastErrorText, "\n";
exit;
}
my $json = Chilkat2::JsonObject->new;
$json->EmitCompact(0);
$http->GetLastJsonData($json);
print $json->Emit(), "\n";
# Output as of Chilkat v11.1.0
# Additional information may be added as requested or needed in future versions of Chilkat.
# {
# "tls": {
# "params": {
# "sniHostname": "www.google.com",
# "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher"
# },
# "negotiatedTlsVersion": "TLS 1.3"
# }
# }