Re: LWP and $content

Martijn Koster (m.koster@nexor.co.uk)
Thu, 03 Aug 1995 18:10:35 +0100


Guy Decoux wrote:

> I just want to indicate to LWP::Request that the
> content must be read from a particular file.
>
> Is this possible actually with LWP::Request, or with another module of LWP

No, that's a bit tricky: the content is not actually used until the
Protocol/whatever module. So not only would yo need to educate the
LWP::Request about files (and don't forget Content-length), you
also need to change all the protocols to use this new interface.
That could be quite a big change... And you might even want a more
generic sub or module approach, rather than restricting yourself
to files. Anyway, that needs careful thought rather than a hack.

If the size of the content is a big problem, it might at least be reduced
by preventing the content copies in LWP::protocol::http::request()...,
and using references instead. That can be done in addition to the current
interface, just add a $request->contentref;

-- Martijn
__________
Internet: m.koster@nexor.co.uk
X-400: C=GB; A= ; P=Nexor; O=Nexor; S=koster; I=M
WWW: http://web.nexor.co.uk/mak/mak.html