script/simple_get.pl untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 36 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use lib '../lib';
5 use LightTCP::SSLclient;
6  
7 my $client = LightTCP::SSLclient->new(timeout => 30);
8 my ($ok, $errors, $debug, $code) = $client->connect('reqbin.com', 443);
9  
10 unless ($ok) {
11 die "Connect failed: @$errors";
12 }
13  
14 ($ok, $errors, $debug, $code) = $client->request('GET', '/echo', host => 'reqbin.com');
15  
16 unless ($ok) {
17 die "Request failed: @$errors";
18 }
19  
20 my ($status, $state, $headers, $body) = $client->response();
21  
22 print "Status: $status $state\n";
23 print "Body length: " . length($body) . " bytes\n";
24 print "\n--- Body preview (first 500 chars) ---\n";
25 print substr($body, 0, 500);
26 print "\n" if length($body) > 500;
27  
28 $client->close();