/usr/share/doc/libhijk-perl/examples/hijkurl is in libhijk-perl 0.26-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Hijk;
use URI;
my ($method, $output_file, $header, $body) = ("GET", "-", "");
my $timeout = 60;
my $dump_header;
GetOptions(
"method|X=s" => \$method,
"H=s", => \$header,
'd=s', => \$body,
"output|o=s" => \$output_file,
"timeout=s" => \$timeout,
"D|dump-header=s" => \$dump_header,
);
$method = uc($method);
my $uri_string = shift(@ARGV) or die "$0 <url>";
my $uri = URI->new($uri_string);
my $res = Hijk::request {
method => $method,
host => $uri->host,
port => $uri->port || 80,
timeout => $timeout*1000,
path => $uri->path,
query_string => $uri->query,
$header ? ( head => [split /: /, $header, 2] ) : (),
$body ? ( body => $body ) : (),
parse_chunked => 1,
};
if ($dump_header) {
for (keys %{$res->{head}}) {
print "$_: $res->{head}{$_}\n";
}
print "\n";
}
print $res->{body};
|