in reply to Remove lwp header
use LWP::Simple qw/ $ua /; $ua->timeout(0.1); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->get( 'http://localhost' ); $ua->get( 'http://localhost', 'X-Requested-With' => 'XMLHttpRequest'); __END__ GET http://localhost User-Agent: LWP::Simple/6.00 libwww-perl/6.05 (no content) GET http://localhost User-Agent: LWP::Simple/6.00 libwww-perl/6.05 X-Requested-With: XMLHttpRequest (no content)
See also LWP::Debug
|
|---|