in reply to Re: Setting HTTP Protocol Version
in thread Setting HTTP Protocol Version

Can u elaborate? I don't see anything in that module's documentation on how to make ur $ua object speak HTTP 1.0 or set the request URI.

update: After staring at it for a while, could u be referring to the implementor function?

use LWP; LWP::Protocol::implementor("http", "LWP::Protocol::http10"); print LWP::Protocol::implementor("http"); ^D LWP::Protocol::http10

Replies are listed 'Best First'.
Re^3: Setting HTTP Protocol Version
by Anonymous Monk on Aug 27, 2009 at 02:08 UTC
    I said copy LWP::Protocol::http10. You then modify it as you see fit (see ->protocol), register as the implementor, and you're finished.
      That makes a little more sense. But what protocol() method are u referring to? U need to increase ur verbosity level. Trying using -vv.
        What the Anonymous Monk is referring to is doing this in your code:
        use LWP; require LWP::Protocol::http10; LWP::Protocol::implementor('http', 'LWP::Protocol::http10'); my $ua = LWP::UserAgent->new(); $ua->get('http://server.local/foo');
        This code would connect to server.local using HTTP/1.0 instead of HTTP/1.1.

        But instead of using LWP::Protocol::http10 as your Protocol implementor, copy LWP::Protocol::http10 code to a new module, perhaps call it MyLWP::Protocol::brokenhttp and change the code in there to use your custom HTTP version and GET format

        Update: This was slightly covered already, but something like: find the LWP/Protocol/http10.pm file in your perl library, copy it to your local lib path as MyLWP/Protocol/brokenhttp.pm then edit it, then use that name as the last option to the implementor function.

        in LWP::Protocol::http10, why aren't you looking?
Re^3: Setting HTTP Protocol Version
by DrHyde (Prior) on Aug 27, 2009 at 09:59 UTC
    The words are spelt "you" and "your". The rest of your message is obviously intelligent, so please don't try to make yourself look like an idiot - you're not very good at it :-)