you can use
LWP::DebugFile
to debug your script and it allows you to see what your calls to LWP are doing behind the scenes. so you get more info than the headers. for browser, I use
LiveHTTPHeaders, the firefox plugin to get the header.
sometimes, it's hard to mimic the request on the first try when remote use js,cookie,user-agent checking etc.
inspect the difference between sending request through browser and through LWP, then fill the difference in your perl script and try again.
oh, i found the headers_as_string is handy too. it ruturns the response header as string which may be suffice for you to check the return header. an example i use is to extract the url out of meta refresh from the response header (LWP only follow http 301,302,303,307 redirect)
use LWP;
my $br = LWP::UserAgent->new;
my $resp = $br ->get('http://www.pulse24.com');
print $resp->headers_as_string";
__END__
Client-Peer: 207.61.136.40:80
Client-Response-Num: 1
REFRESH: 0;URL=http://www.pulse24.com/Front_Page/page.asp
X-Meta-Robots: noindex
X-Powered-By: ASP.NET
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.