#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->get( 'http://www.perlmonks.org/' ); my $response = $mech->response(); for my $key ( $response->header_field_names() ) { print $key, " : ", $response->header( $key ), "\n"; } # Or if you know the header key in advance my $header = $mech->response()->header( 'key' );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: HTTP Headers Using WWW::Mechanize
by holli (Abbot) on Jan 31, 2005 at 18:26 UTC | |
by Limbic~Region (Chancellor) on Jan 31, 2005 at 18:31 UTC | |
Re: HTTP Headers Using WWW::Mechanize
by merlyn (Sage) on Jan 31, 2005 at 19:48 UTC | |
by Limbic~Region (Chancellor) on Jan 31, 2005 at 20:08 UTC | |
by petdance (Parson) on Jan 31, 2005 at 21:36 UTC | |
by Limbic~Region (Chancellor) on Feb 01, 2005 at 14:19 UTC | |
by igoryonya (Pilgrim) on Oct 15, 2022 at 01:11 UTC | |
by marto (Cardinal) on Oct 15, 2022 at 13:34 UTC | |
|