in reply to Re: Trying to get HTTP/1.1 at end of request
in thread Trying to get HTTP/1.1 at end of request

Here's the solution I finally ended up with. First, I build the command string using the parameters hashref:

my $cmd = "$baseURL/$command?" . join( '&', map { "$_=" . uri_escape( $parameters->{$_} ) } keys %$parameters );
Then I build the HTTP::Request object, adding the Host parameter (as a flattened hashref), and set the request's protocol:
my $request = HTTP::Request->new( 'GET', $cmd, [ 'Host', $host ] ); $request->protocol('HTTP/1.1');
Finally, I use LWP::UserAgent to send the request:
my $agent = LWP::UserAgent->new(); my $response = $agent->request($request);
So it looks like both the HTTP/1.1 at the end of the request and the Host parameter in the header were required.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds