http://qs321.pair.com?node_id=1213475

Veltro has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'd like to remove the Keep-Alive 300 header from the request but I can't figure out how.

I am instantiating the LWP::UserAgent with the intention to use HTTP 1.1 and keeping the connection alive as follows:

my $ua = LWP::UserAgent->new(keep_alive => 1, send_te => 0) ;

send_te => 0 removes the TE header and the header information that I want to send contains tags like:
my @ns_headers = ( 'ACCEPT' => '..', 'ACCEPT_ENCODING' => '...', 'ACCEPT-LANGUAGE => '..', 'UPGRADE_INSECURE_REQUESTS' => '1', 'USER-AGENT' => '...', ) ;
I have tried several methods creating the request but each and one of them sends the Keep-Alive 300 header.

my $response = $ua->get( $link, @ns_headers ) ;

my $response = $ua->request(GET $link) ; # This does not use @ns_headers
my $getReq = HTTP::Request->new( GET => $link, HTTP::Headers->new( @ns +_headers ) ) ; my $response = $ua->request( $getReq ) ;
Tryig to get rid of it by specifying this in the @ns_headers does not work:

'KEEP-ALIVE' => undef,

Anyone knows how to do this? Thanks