develooper Front page | perl.libwww | Postings from March 2003

Re: getting the last N bytes of something over HTTP

Thread Previous | Thread Next
From:
merlyn
Date:
March 13, 2003 07:52
Subject:
Re: getting the last N bytes of something over HTTP
Message ID:
86el5bxnzk.fsf@red.stonehenge.com
>>>>> "Sean" == Sean M Burke <sburke@cpan.org> writes:

Sean> As I was setting up this RSS feed the other day
Sean> http://www.speech.cs.cmu.edu/~sburke/new_rfcs.rss
Sean> I had occasion to want to request the last N bytes of a particular URL.
Sean> And this is how I did it, with LWP:

From rfc2068:

   A suffix-byte-range-spec is used to specify the suffix of the
   entity-body, of a length given by the suffix-length value. (That is,
   this form specifies the last N bytes of an entity-body.) If the
   entity is shorter than the specified suffix-length, the entire
   entity-body is used.

     o  The final 500 bytes (byte offsets 9500-9999, inclusive):

          bytes=-500

So, you went to a lot of extra work.  Could have done it in
one hit.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About