Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Mocking request headers with Test::WWW::Mechanize?

by Corion (Patriarch)
on Oct 25, 2021 at 14:10 UTC ( #11138016=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2022-01-27 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?