2 # Test mirroring a file
5 require "net/config.pl";
6 require LWP::Protocol::http;
7 require LWP::UserAgent;
12 my $ua = new LWP::UserAgent; # create a useragent to test
14 my $url = "http://$net::httpserver/";
15 my $copy = "lwp-test-$$"; # downloaded copy
17 my $response = $ua->mirror($url, $copy);
19 if ($response->code == &HTTP::Status::RC_OK) {
26 # OK, so now do it again, should get Not-Modified
27 $response = $ua->mirror($url, $copy);
28 if ($response->code == &HTTP::Status::RC_NOT_MODIFIED) {
36 $net::httpserver = $net::httpserver; # avoid -w warning