File: profile.pl

package info (click to toggle)
libfurl-perl 3.14-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 660 kB
  • sloc: perl: 2,188; makefile: 5; sh: 1
file content (22 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Furl::HTTP qw/HEADERS_NONE HEADERS_AS_ARRAYREF/;
use URI;

my $url = shift @ARGV || 'http://127.0.0.1:80/';
my $uri = URI->new($url);
my $host       = $uri->host;
my $port       = $uri->port;
my $path_query = $uri->path_query;

my $furl = Furl::HTTP->new(header_format => HEADERS_NONE, bufsize => 10_000_000);
for (1..1000) {
    my ( $version, $code, $msg, $headers, $content ) = $furl->request(
        method     => 'GET',
        host       => $host,
        port       => $port,
        path_query => $path_query,
    );
    $code == 200 or die "oops : $code, $content";
}