LWP comes with lwp-request program, very useful
> lwp-request -USexd -m get http://cpan.org/ LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://cpan.org/ LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 782 bytes LWP::Protocol::collect: read 1880 bytes LWP::Protocol::collect: read 1256 bytes LWP::UserAgent::request: Simple response: OK GET http://cpan.org/ User-Agent: lwp-request/5.810 GET http://cpan.org/ --> 200 OK Connection: close Date: Thu, 17 Jul 2008 03:20:43 GMT Accept-Ranges: bytes ETag: "a9dc69-f4e-487d100c" Server: Apache/1.3.37 Content-Length: 3918 Content-Type: text/html Content-Type: text/html Last-Modified: Tue, 15 Jul 2008 21:01:00 GMT Client-Date: Thu, 17 Jul 2008 03:24:58 GMT Client-Peer: 66.39.76.93:80 Client-Response-Num: 1 Link: <mailto:cpan@perl.org>; rev="made" Title: CPAN
You can see request headers (option -U). If you examine lwp-request source, you'll see
if ($options{'u'} || $options{'U'}) { my $url = $response->request->url->as_string; print "$method $url\n"; print $response->request->headers_as_string, "\n" if $options{ +'U'}; }
More details in HTTP::Response documentation.

In reply to Re: LWP Post Question by Anonymous Monk
in thread LWP Post Question by drblove27

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.