Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PERL

perl mechanize check mirror response for errors

my $response = $mech->mirror($abs_url, $filename)->message;
            print Dumper($response); #print response: [OK, Not Found, Not Modified]
            if($response eq 'Not Found'){
                #responds code here to error trying to download.
            }
            if($response eq 'Not Modified'){
                #responds code here to unmodified download.
            }
            if($response eq 'OK'){
                #responds code here to download successfully.
            }
 
PREVIOUS NEXT
Tagged: #perl #mechanize #check #mirror #response #errors
ADD COMMENT
Topic
Name
1+1 =