I think that should be possible by simply giving the HTTP::Request a code reference as value for the content key, and that code reference then supplies the content. I don't know why this wasn't mentioned yet, but I'm too lazy to check it myself in the documentation.
Update: Quoth the LWP::UserAgent documentation:
$ua->request( $request, $content_cb )...
The request methods described above; get(), head(), post() and mirror(), will all dispatch the request they build via this method. They are convenience methods that simply hides the creation of the request object for you.
The $content_file, $content_cb and $read_size_hint all correspond to options described with the get() method above.
You are allowed to use a CODE reference as content in the request object passed in. The content function should return the content when called. The content can be returned in chunks. The content function will be invoked repeatedly until it return an empty string to signal that there is no more content.
I know it was there somewhere.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
In reply to Re: Re: Reducing LWP Buffering
by Corion
in thread Reducing LWP Buffering
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |