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

multipart responses

From:
Sean M. Burke
Date:
March 13, 2003 00:42
Subject:
multipart responses
Message ID:
5.1.0.14.1.20030312233955.02480e10@mail.spinn.net
And speaking of range requests... a request for several ranges returns a
multipart mime object as the response. Does anyone know if/where in LWP
there's a module for breaking the response into its constituent parts
(presumably as a list of HTTP::Response objects?)

See:

use LWP;
print LWP::UserAgent->new->get(
   'http://mailman.rfc-editor.org/pipermail/rfc-dist.mbox/rfc-dist.mbox',
   "Range" => "bytes=0-4,20-24"
)->as_string;

Prints:

HTTP/1.1 206 (Partial Content) Partial content
Connection: close
Date: Thu, 13 Mar 2003 08:39:12 GMT
ETag: "173974-1083d3-3e6f9c51"
Server: Netscape-Enterprise/3.6 SP3
Content-Type: multipart/x-byteranges; boundary=57142883419335
Last-Modified: Wed, 12 Mar 2003 20:45:05 GMT
Client-Date: Thu, 13 Mar 2003 08:39:13 GMT
Client-Response-Num: 1



--57142883419335

Content-type: text/plain
Range: bytes 0-4/1082323

 From

--57142883419335

Content-type: text/plain
Range: bytes 20-24/1082323

e May

--57142883419335--

--
Sean M. Burke    http://search.cpan.org/~sburke/




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