in reply to Re^2: libwww-perl basics
in thread libwww-perl basics
The docs for HTTP::Response don't give a method to access the HTTP::Headers object, but it mentions that it's a subclass of HTTP::Message. So we have to take a look at the documentation for HTTP::Message, and there we see that it provides the headers method to give you a reference to the HTTP::Headers object. So assuming $ua is an HTTP::Response object, you'd do something like this:
for my $header (@{$ua->headers->header_field_names}) { print $header, ": ", $ua->header($header), "\n"; }
Note: I don't write web apps, so I've never used the HTTP classes, so this is (of course!) untested. But hopefully it will lead you in the right direction.
...roboticus
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: libwww-perl basics
by Anonymous Monk on Aug 12, 2010 at 15:31 UTC | |
by roboticus (Chancellor) on Aug 12, 2010 at 18:23 UTC | |
by Anonymous Monk on Aug 13, 2010 at 10:42 UTC | |
|
Re^4: libwww-perl basics
by rowdog (Curate) on Aug 12, 2010 at 17:41 UTC |