dump LWP with DEBUG=1
[ILL-Zotero-RT] / CouchDB.pm
index 9512174..9f8cf56 100644 (file)
@@ -15,6 +15,11 @@ sub new {
   $ua->timeout(10);
   $ua->env_proxy;
 
+  if ( $ENV{DEBUG} ) {
+       $ua->add_handler("request_send",  sub { shift->dump; return });
+       $ua->add_handler("response_done", sub { shift->dump; return });
+  }
+
   return bless {
                 ua       => $ua,
                 host     => $host,