Edit

My previous response was wrong -- I had not read your question correctly. You want the complete request.

DB<3> p $req->as_string() GET http://search.cpan.org/dist/libwww%E2%88%92perl/ Accept: text/html

nope..

p $req->dump GET http://search.cpan.org/dist/libwww%E2%88%92perl/ Accept: text/html (no content)

Not there either...

If you debug waaaay down into the code you'll find it in an object stored in a variable but nothing you can access externally:

LWP::Protocol::http::request(/usr/lib/perl5/site_perl/5.10.0/LWP/Proto +col/http.pm:226): 226: if (!$has_content || $write_wait || $has_content > 8*1024) + { DB<17> p $req_buf GET /dist/libwww%E2%88%92perl/ HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Accept: text/html Host: search.cpan.org User-Agent: lwpcooktest.pl/0.1 libwww-perl/6.03

The previous response about capturing the request with an echo server of some kind is the safest way to go.

Celebrate Intellectual Diversity


In reply to Re: LWP is there any way to get "real" outgoing headers? by InfiniteSilence
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.