Subject: | add_handler() doesn't appear to work when default_headers() is used |
Apparently add_handler() is the new recommended way of debugging LWP-
but it doesn't appear to work when default_headers are specified.
Attached is a test script which demonstrates this.
Subject: | try.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use Compress::Zlib;
use Data::Dump;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
#$ua->default_headers(accept_encoding => 'gzip,deflate');
$ua->default_headers(dingo => 123);
$ua->add_handler(request_send => sub { shift->dump; return });
my $res = $ua->get('http://www.google.com/');
ddx $res->request;