in reply to How to download JUST the first X bytes of HTTP response ?
This worked (fetched just the first 1000 bytes) for every server I tried from a random selection thrown up by google image search:
#! perl -slw use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $resp = $ua->get( "http://www.somesite.com/product_images/theImage.jpg", Range => 'bytes=0-999' ) or die; print unpack 'H*', $resp->content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to download JUST the first X bytes of HTTP response ?
by fx (Pilgrim) on Dec 09, 2010 at 15:16 UTC | |
by BrowserUk (Patriarch) on Dec 09, 2010 at 15:43 UTC |