in reply to LWP - test website at multiple IPs

I would think that I should be able to use the IP address in the URL (http://1.2.3.4/) and force a Host header in a LWP request somehow, but after looking at the LWP documentation and trying several different approach, I've not come up with anything that works.

That was my first thought as well, and it seems to work just fine for me:

$ua = new LWP::UserAgent; print $ua->get("http://1.2.3.4/", Host => "www.domain.com")->content;

Replies are listed 'Best First'.
Re^2: LWP - test website at multiple IPs
by mp (Deacon) on Aug 11, 2005 at 15:57 UTC
    Thank you. This works perfectly. The request is made to IP=1.2.3.4, and the host header www.domain.com is sent in the request.