Hello,

I am trying to use HTTP::Tiny module to download file with RANGE attribute.
However I cannot accomplish it.

In WWW::Mechanize the code I use is simple
my $file_obj = $ua->get( $url, 'Range' => sprintf("bytes=%s-%s",
$file_size, $content_length - 1), ) or die;

But I want to use the Tiny Module. How do I do this in HTTP::Tiny?

In the doc it says I have to give it a \%options hash-ref.
my %options= { default_headers => "Range => bytes=0-999", };
my $file_obj = $ua->get( $url, \%options ) or die;

something like above or am I sorely mistaken?
The above code doesn't work. Even if half file exists the whole file is
re-downloaded so range attribute doesn't work.
I checked the length of downloaded content in debugger.  May be the hash
ref thing I am doing is wrong!

A sample code will be most helpful.

Thanks in advance.

HTTP::Tiny Documentation
http://search.cpan.org/~dagolden/HTTP-Tiny-0.021/lib/HTTP/Tiny.pm

Reply via email to