|
NAMEHTTP::Size - Get the byte size of an internet resource SYNOPSISTHIS IS AN ABANDONED MODULE. YOU CAN ADOPT IT. https://pause.perl.org/pause/authenquery?ACTION=pause_04about#takeover use HTTP::Size
my $size = HTTP::Size::get_size( $url );
if( defined $size ) {
print "$url size was $size";
}
elsif( $HTTP::Size::ERROR == $HTTP::Size::INVALID_URL ) {
print "$url is not a valid absolute URL";
}
elsif( $HTTP::Size::ERROR == $HTTP::Size::COULD_NOT_FETCH ) {
print "Could not fetch $url\nHTTP status is $HTTP::Size::HTTP_STATUS";
}
elsif( $HTTP::Size::ERROR == $HTTP::Size::BAD_CONTENT_LENGTH ) {
print "Could not determine content length of $url";
}
DESCRIPTIONVARIABLESThe following global variables describes conditions from the last function call: $ERROR
$HTTP_STATUS
The $ERROR variable may be set to any of these values: $INVALID_URL - the URL is not a valid absolute URL
$COULD_NOT_FETCH - the function encountered an HTTP error
$BAD_CONTENT_LENGTH - could not determine a content type
The module does not export these variables, so you need to use the full package specification outside of the HTTP::Size package. FUNCTIONS
TO DO* if i have to use GET, i should use Byte-Ranges to avoid downloading the whole thing * add a way to specify Basic Auth credentials * download javascript and style sheets too. SEE ALSOHTML::SimpleLinkExtor SOURCE AVAILABILITYThis source is part of a GitHub project: https://github.com/CPAN-Adoptable-Modules/http-size AUTHORbrian d foy, "<bdfoy@cpan.org>" COPYRIGHT AND LICENSECopyright © 2000-2021, brian d foy <bdfoy@cpan.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
|