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