> Your question makes no sense.
Well. taint, with all due respect, your reply (all 3 of them) make even less sense than my question. Since you replying on something different.
And once again - I'm not here to insult someone, that's pointless. I'm just trying to solve issue I have. But according to replies above that's not possible with LWP itself (I'll need to use another modules or hack original ones).

I'm clearly asking how to get outgoing headers, generated by LWP, not how to modify/change them (I know how to do that and successfully doing that for years in my code).
Now I need to log them.
The problem is - LWP return headers different to headers which he sent out.

Headers I can get from LWP, for example using $response->request()->as_string():

GET http://example.com/ User-Agent: libwww-perl/6.05

Headers LWP sent out (catched using sniffer):
GET / HTTP/1.1 Host: example.com User-Agent: libwww-perl/6.05 Connection: keep-alive

Of course both from same HTTP session. And I posted those logs in my original question. You see the difference?

You could read edited reply from InfiniteSilence above.

"I'm looking for a way to get "real" outgoing headers, generated by LWP (I need them for logging/debugging purpose)."
So, what exactly wrong with my question? (except bad English)

P.S. And just for your info, you can't control all headers, using code you posted above. In code, I posted as example in my initial question you will see how you can control Connection (to avoid sending "TE, close" instead of "keep-alive") and how to change HTTP version to 1.0 / 1.1 (in case you need that).


In reply to Re^4: LWP is there any way to get "real" outgoing headers? by Anonymous Monk
in thread LWP is there any way to get "real" outgoing headers? by Anonymous Monk

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.