On Fri, Sep 19, 2003 at 06:40:18AM -0700, Gisle Aas said:
> There is no direct way to do it currently. You might be able to just
> make your own subclass of LWP::Protocol::http that does what you want.
> You then need to register it as the HTTP handler module with:
>
> LWP::Protocol::implementor('http', 'MyHTTP');
>
> given that you called your LWP::Protocol::http subclass MyHTTP.
After a discussion with David and a bit of hackery I've packaged up his
code as a standalone module and was considering releasing it to CPAN.
Currently the interface looks something like this
use LWP::UserAgent;
use LWP::Protocol::http::Timed qw(autoinstall);
my $ua = new LWP::UserAgent;
my $response = $ua->get("http://thegestalt.org");
printf "%f\n", $response->header('X-Request-Connect-Time');
or, more explicitly
use LWP::UserAgent;
use LWP::Protocol;
LWP::Protocol::implementor('http', 'LWP::Protocol::http::Timed');
my $ua = new LWP::UserAgent;
my $response = $ua->get("http://thegestalt.org");
printf "%f\n", $response->header('X-Request-Connect-Time');
does that seem sane?
I'm not entirely in love with the name either so suggestions welcome.
Simon