http://qs321.pair.com?node_id=11138016


in reply to Mocking request headers with Test::WWW::Mechanize?

Maybe you can set the Host header using the ->add_header( Host => 'my.example.com') method from WWW::Mechanize? This should add/remove headers sent with every request.

Replies are listed 'Best First'.
Re^2: Mocking request headers with Test::WWW::Mechanize?
by Anonymous Monk on Oct 25, 2021 at 14:37 UTC
    Wow! Yes, that was easy enough. I assumed add_header was only for additional headers, not for modifying the "core" headers. But that did it exactly. Thank you!