Hi

Well, since you responded to jeffenstein, here you go Veltro

LWP header -> Re: LWP is there any way to get "real" outgoing headers?

#!/usr/bin/perl -- use strict; use warnings; use LWP; use Data::Dump(); sub LWP::Protocol::http::SocketMethods::format_request { package LWP::Protocol::http::SocketMethods; my( $socket, $method, $fullpath, @h ) = @_; #~ my $req_buf = $socket->Net::HTTP::Methods::format_request($meth +od, $fullpath, @h, 'Keep-Alive',666); ## fail, adds another header my $req_buf = $socket->Net::HTTP::Methods::format_request($method, + $fullpath, @h ); $req_buf =~ s{Keep-Alive: 300}{Keep-Alive: 30}g; ## win, removes e +xisting header Data::Dump::dd( $req_buf ); return $req_buf; } LWP::UserAgent->new( keep_alive=>1 )->get( q{http://127.0.0.1:80/} )-> +dump; __END__ "GET / HTTP/1.1\r\nTE: deflate,gzip;q=0.3\r\nKeep-Alive: 30\r\nConnect +ion: Keep-Alive, TE\r\nHost: 127.0.0.1:80\r\nUser- Agent: libwww-perl/6.15\r\n\r\n" HTTP/0.9 200 Assumed OK Client-Date: Tue, 24 Apr 2018 23:25:20 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 Echo: GET / HTTP/1.1\r Echo: TE: deflate,gzip;q=0.3\r Echo: Keep-Alive: 30\r Echo: Connection: Keep-Alive, TE\r Echo: Host: 127.0.0.1:80\r Echo: User-Agent: libwww-perl/6.15\r Echo: \r\n

In reply to Re: How to remove HTTP Keep-Alive 300 header from LWP::UserAgent request by Anonymous Monk
in thread How to remove HTTP Keep-Alive 300 header from LWP::UserAgent request by Veltro

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.