Add a paragraph to summarize the motivation for releases since 5.815
[libwww-perl-eserte.git] / t / net / http-get.t
blob2d559b45b53fd2f77a9a3263c76afc8beb53afa7
1 #!/usr/local/bin/perl -w
3 # Check GET via HTTP.
6 print "1..2\n";
8 require "net/config.pl";
9 require LWP::Protocol::http;
10 require LWP::UserAgent;
12 my $ua = new LWP::UserAgent; # create a useragent to test
14 $netloc = $net::httpserver;
15 $script = $net::cgidir . "/test";
17 $url = new URI::URL("http://$netloc$script?query");
19 my $request = new HTTP::Request('GET', $url);
21 print "GET $url\n\n";
23 my $response = $ua->request($request, undef, undef);
25 my $str = $response->as_string;
27 print "$str\n";
29 if ($response->is_success and $str =~ /^REQUEST_METHOD=GET$/m) {
30 print "ok 1\n";
32 else {
33 print "not ok 1\n";
36 if ($str =~ /^QUERY_STRING=query$/m) {
37 print "ok 2\n";
39 else {
40 print "not ok 2\n";
43 # avoid -w warning
44 $dummy = $net::httpserver;
45 $dummy = $net::cgidir;