Gisle_Aas via RT schrieb:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=41759 >
>
> I've now restored the old code of LWP::Debug so that 3rd party modules (like
> LWP::UserAgent::Determined) can continue to run as before.
>
> The reason the LWP::Debug was removed was I did not find it pretty, nor very useful and that
> it's coverage was already pretty bad.
>
Hmm - i find the possibility to debug is always usefull.
When you google for debugging the LWP module you will always find only
LWP::Debug as solution.
Show quoted text> If you want to debug the HTTP traffic that LWP generates I suggest that you instead use a OS
> level tool like wireshark or strace. That's what I do.
>
O.K. Thank you for the hint!
It would be nice to add it to the LWP::Debug documentation.
Normally you think first to debug in the code itself.
Show quoted text> If you don't need that kind of detail you might generate traces of the requests/responses
> passed through with simple monitoring handlers like this:
>
> use LWP::UserAgent;
> $ua = LWP::UserAgent->new;
> $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable());
>
> $ua->add_handler("request_send", sub { shift->dump; return });
> $ua->add_handler("response_done", sub { shift->dump; return });
>
> $ua->get("
http://www.example.com");
>
>
Another very good hint that should be added.
Cheers
Karsten