ASNMTAP
view release on metacpan or search on metacpan
lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod view on Meta::CPAN
is an string that controls how many times it should retry, and how long the pauses should be, values greater then 0 separated by a ',' or undef (default)
When triesTiming equals undef or an empty-string, this means not to retry at all.
If you specify a string with several numbers in it (like '1,3,15'), then that means WebTransact can retry as that many times (i.e., one initial try, plus a maximum of the three retries, because three numbers there), and that it should wait first thos...
So triesTiming => '1,3,15' basically means:
try the request; return it unless it's a temporary-looking error;
sleep 1;
retry the request; return it unless it's a temporary-looking error;
sleep 3;
retry the request; return it unless it's a temporary-looking error;
sleep 15;
retry the request; return it;
=item I<triesCodes>
Is an string of HTTP codes that merit a retry (like 500 and 408, but unlike 404 or 200), values greater then 200 separated by a ',' or '408,500,502,503,504' (default).
408 Request Timeout: The client did not send a request within the required time period
500 Can't connect to ..., Connect failed, Proxy connect failed, Server Error, SSL negotiation failed, SSL read timeout or Internal Server Error: The server had some sort of internal error trying to fulfil the request. The client may see a partial p...
502 Bad Gateway: Bad Gateway: a server being used by this Web server has sent an invalid response. The response by an intermediary server was invalid. This may happen if there is a problem with the DNS routing tables.
503 Service Unavailable: Service temporarily unavailable because of currently/temporary overload or maintenance.
504 Gateway Timeout: The server did not respond back to the gateway within acceptable time period
=item I<openAppend>
Is an scalar, open debugfile as 'Writes, Appends, and Creates' mode when 1, otherwise open debugfile in 'Creates, Writes, and Truncates' mode.
=item I<cookies>
Is an scalar, value is 0 or 1 (default)
=item I<protocol>
0 = default and 1 = force 'HTTP/1.1'
Is an scalar, value is 0 or 1 (default)
=item I<keepAlive>
0 = default and 1 = 'Keep-Alive'
Is an scalar, value is 0 or 1 (default)
=item I<download_images>
get the images found by HTML::LinkExtor in the page, provided those images have not already been ed.
Is an scalar, value is 0 (default) or 1
=item I<fail_if_1>
B<fail_if_1> if set (the default) causes the check to fail when the first
web page fails. Clearing this flag is useful if you want to get a bunch of
pages and return a failure if they B<all> fail.
Is an scalar, value is 0 or 1 (default)
check semantics:
$fail_if_1 ? return $ERRORS{CRITICAL} if any URL fails
! $fail_if_1 ? return $ERRORS{CRITICAL} if all URLs fail
(same as return $ERRORS{OK} if any URL ok)
=back
I<Example:>
$objectWebTransact->check ( { } );
undef $objectWebTransact;
=item $objectWebTransact->matches()
Set and/or get matches
=item $objectWebTransact->get_matches()
Get the matched values from the last downloaded url
foreach ( @{ $objectWebTransact->get_matches() } ) { print $_, "\n"; }
=item $objectWebTransact->set_matches()
Set the match values for the next url to download
$objectWebTransact->set_matches( ['a', 'b', 'c', 1, 2, 3] );
=item $objectWebTransact->returns()
Set and/or get the return keys and values for all urls
=item $objectWebTransact->get_returns()
Get the return keys and values from all downloaded urls
while ( my ($key, $value) = each %{ $objectWebTransact->get_returns() } ) {
if ( ref $value eq 'ARRAY') {
foreach ( @{ $value } ) { print "$key => $_\n"; }
} else {
print "$key => $value\n";
}
}
=item $objectWebTransact->set_returns()
Set the return keys and values from all next urls to download
$objectWebTransact->set_returns( { ape => 'lucky' } );
=item $objectWebTransact->urls()
Set and/or get the urls
=item $objectWebTransact->get_urls()
( run in 0.676 second using v1.01-cache-2.11-cpan-39bf76dae61 )