Leser: 20
QuoteLocation: /bat/content/view/home
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper qw/Dumper/; use Perl6::Say; use FindBin qw/$Bin/; my $url = 'http://board.perl-community.de/'; use LWP::UserAgent; use HTTP::Request; my $ua = LWP::UserAgent->new(); $ua->agent("MyApp/0.1 "); # Create a request my $req = HTTP::Request->new(GET => $url); my $res = $ua->request($req); print $res->status_line();
1
2
3
4
5
6
7
8
9
HTTP/1.1 302 Found
Date: Wed, 12 May 2010 11:06:15 GMT
Server: Apache
Set-Cookie: battie_sid=id&5c90d353b726f2d6133af73cac67c3853449e0fb8f5078064c907654cd2aaabb; path=/bat; expires=Wed, 12-May-2010 12:06:15 GMT
Location: /bat/content/view/home
Content-Length: 0
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Content-Type: text/plain
2010-05-12T11:15:34 pqbzw. vielleicht kann man auch irgendwo automatische redirects abschalten.
$ua->requests_redirectable([]);