Closed zorgnax closed 7 years ago
Have you tried LWP::ConsoleLogger
? An easy way to get started is by adding:
use LWP::ConsoleLogger::Everywhere ();
That will give you lots of debugging output. You can pare it down from there. Check LWP::ConsoleLogger::Easy
for more information.
I can dump the response myself with a very long line everytime I need it, I just think it belongs in WWW::Mechanize or HTTP::Response since there are a lot of other dump subroutines in there. kinda surprised this isn't one of them.
The method I pointed out works in both WWW::Mechanize
and LWP::UserAgent
. It's a short one-liner, so I don't see a lot of overhead in using it.
@petdance what do you think about adding another dump method to WWW::Mechanize
?
I think that if you write a function that does print $m->response->status_line() . "\n" . $m->response->headers->as_string() . "\n" . $m->response->decoded_content() . "\n";
that then someone will want a version that doesn't include the status line, and someone else will want one that includes cookies only, and so on, and nobody nobody will be happy with it.
That seems like the logical outcome.
There is a dump
method.
https://metacpan.org/pod/HTTP::Message#$mess->dump(-%opt-)
Is there a method, or can you add a method that will print the full text of the response in one go. Something like this: