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 $response = $ua->get( $link, @ns_headers ) ;
my $response = $ua->request(GET $link) ; # This does not use @ns_headers
'KEEP-ALIVE' => undef,
Anyone knows how to do this? Thanks
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:
I have tried several methods creating the request but each and one of them sends the Keep-Alive 300 header.my @ns_headers = ( 'ACCEPT' => '..', 'ACCEPT_ENCODING' => '...', 'ACCEPT-LANGUAGE => '..', 'UPGRADE_INSECURE_REQUESTS' => '1', 'USER-AGENT' => '...', ) ;
my $response = $ua->get( $link, @ns_headers ) ;
my $response = $ua->request(GET $link) ; # This does not use @ns_headers
Tryig to get rid of it by specifying this in the @ns_headers does not work:my $getReq = HTTP::Request->new( GET => $link, HTTP::Headers->new( @ns +_headers ) ) ; my $response = $ua->request( $getReq ) ;
'KEEP-ALIVE' => undef,
Anyone knows how to do this? Thanks
|
---|
Back to
Seekers of Perl Wisdom