"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/xt/author/live/apache-http10.t" (26 Nov 2019, 471 Bytes) of package /linux/www/libwww-perl-6.43.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use strict;
    2 use warnings;
    3 use Test::More;
    4 use Test::RequiresInternet ('www.google.com' => 80);
    5 
    6 use HTTP::Request;
    7 use LWP::UserAgent;
    8 
    9 plan tests => 2;
   10 
   11 my $ua = LWP::UserAgent->new;
   12 my $req = HTTP::Request->new(HEAD => "http://www.google.com/");
   13 
   14 $req->protocol("HTTP/1.0");
   15 
   16 my $res = $ua->simple_request($req);
   17 isa_ok($res, 'HTTP::Response', 'simple_request: Got a proper response');
   18 is($res->protocol, 'HTTP/1.0', 'Request to google.com: Got an HTTP 1.0 response');