in reply to Re: Re: LWP::UserAgent Wrongly Uses HTTP/1.1
in thread LWP::UserAgent Wrongly Uses HTTP/1.1

Just a caveat, since your code makes me think you misunderstand just a wee bit. The implementor matters at the time you make the request, not when you create the user agent object. So in your example, if you add the line

$ua->request($req);

at the end there, I think you'll find that it makes an HTTP/1.1 request, not HTTP/1.0 like your code leads me to believe you might be thinking (your code suggests to me that you think you have now an 'HTTP/1.0 user agent' ($ua) and an 'HTTP/1.1 user agent' ($ua2) and you can just alternate UAs to alternate which protocol to use). See the code I suggested above in my update.

At least, this is the behavior I found when I tested with my version, which may be different from yours.

HTH

--
3dan

Replies are listed 'Best First'.
Re: Re: Re: Re: LWP::UserAgent Wrongly Uses HTTP/1.1
by Anonymous Monk on Nov 20, 2003 at 15:27 UTC
    True--I posed the code the way I did because my actual script does create two seperate agents/requests (for other non-related organizational reasons). It probably would have been clearer for other folks had I done it with one agent/request as you suggest. You are correct in saying that it matters at the time of the request though.