1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl use 5.008; use strict; use warnings; use HTTP::Message; use LWP::UserAgent; my $url = 'http://labs.gwendragon.de/'; my $ua = LWP::UserAgent->new; my $can_accept = HTTP::Message::decodable; my $response = $ua->get( $url, 'Accept-Encoding' => $can_accept, ); print $response->{_headers}->as_string;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 10:32:37 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 1038
Content-Type: text/html
Expires: Mon, 22 Oct 2012 12:32:37 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 10:32:37 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=726
X-Powered-By: Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 10:34:24 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Length: 2569
Content-Type: text/html
Expires: Mon, 22 Oct 2012 12:34:24 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 10:34:11 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
Content-Script-Type: text/javascript
Content-Style-Type: text/css
Link: <css/standard.css>; media="all"; rel="stylesheet"; type="text/css"
Link: </favicon.ico>; rel="shortcut icon"; type="image/x-icon"
Title: Domina de Ignis ÔÇô GwenDragons programmatische Hexenk├╝che
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=691
X-Meta-Copyright: (c)2011 by GwenDragon
X-Meta-Description: Testlabor von GwenDragon
X-Meta-Keywords: Programme, Testlabor, Projekte, Bugs, Browser-Bugs
X-Meta-Language: de
X-Meta-Publisher: GwenDragon
X-Meta-Robots: noindex,nofollow
X-Meta-Robots: noarchive
X-Meta-Robots: noodp
X-Powered-By: Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
X:\tmp>curl -I -H "Accept-Encoding: gzip,deflate" http://labs.gwendragon.de/
HTTP/1.1 200 OK
Date: Mon, 22 Oct 2012 10:59:46 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
ETag: "1c8a880-a09-4bbc1209bb440"
Accept-Ranges: bytes
Cache-Control: max-age=7200
Expires: Mon, 22 Oct 2012 12:59:46 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
X-LoadTime: D=647
X-Powered-By: Perl
Content-Length: 1038
Content-Type: text/html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
DEBUG: Accept can be: gzip, x-gzip, deflate, x-bzip2
####
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 11:00:30 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Length: 2569
Content-Type: text/html
Expires: Mon, 22 Oct 2012 13:00:30 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 11:00:16 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
Content-Script-Type: text/javascript
Content-Style-Type: text/css
Link: <css/standard.css>; media="all"; rel="stylesheet"; type="text/css"
Link: </favicon.ico>; rel="shortcut icon"; type="image/x-icon"
Title: Domina de Ignis ÔÇô GwenDragons programmatische Hexenk├╝che
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=605
X-Meta-Copyright: (c)2011 by GwenDragon
X-Meta-Description: Testlabor von GwenDragon
X-Meta-Keywords: Programme, Testlabor, Projekte, Bugs, Browser-Bugs
X-Meta-Language: de
X-Meta-Publisher: GwenDragon
X-Meta-Robots: noindex,nofollow
X-Meta-Robots: noarchive
X-Meta-Robots: noodp
X-Powered-By: Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DEBUG: Accept can be: gzip, x-gzip, deflate, x-bzip2
####
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 11:02:00 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 1038
Content-Type: text/html
Expires: Mon, 22 Oct 2012 13:02:00 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 11:02:00 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=737
X-Powered-By: Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl use 5.008; use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( GET => 'http://labs.gwendragon.de/'); $req->header( 'Accept' => 'text/html', 'Accept-Encoding' => 'gzip, deflate', ); # send request my $res = $ua->request($req); print $req->headers->as_string, "\n\n"; # check the outcome print $res->headers->as_string, "\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Accept: text/html
Accept-Encoding: gzip, deflate
User-Agent: libwww-perl/6.04
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 11:36:33 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Length: 2569
Content-Type: text/html
Expires: Mon, 22 Oct 2012 13:36:33 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 11:36:20 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
Content-Script-Type: text/javascript
Content-Style-Type: text/css
Link: <css/standard.css>; media="all"; rel="stylesheet"; type="text/css"
Link: </favicon.ico>; rel="shortcut icon"; type="image/x-icon"
Title: Domina de Ignis ÔÇô GwenDragons programmatische Hexenk├╝che
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=791
X-Meta-Copyright: (c)2011 by GwenDragon
X-Meta-Description: Testlabor von GwenDragon
X-Meta-Keywords: Programme, Testlabor, Projekte, Bugs, Browser-Bugs
X-Meta-Language: de
X-Meta-Publisher: GwenDragon
X-Meta-Robots: noindex,nofollow
X-Meta-Robots: noarchive
X-Meta-Robots: noodp
X-Powered-By: Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Accept: text/html
Accept-Encoding: gzip, deflate
User-Agent: libwww-perl/6.04
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 11:36:51 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 1038
Content-Type: text/html
Expires: Mon, 22 Oct 2012 13:36:51 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 11:36:51 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=657
X-Powered-By: Perl
Vary: ... User-Agent
HTTP::Message
Quotecpan> i /IO::Uncompress/
Module = IO::Uncompress::Adapter::Bunzip2 (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Adapter::Identity (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Adapter::Inflate (PMQS/IO-Compress-2.055.tar.gz)
Module < IO::Uncompress::Adapter::LZO (PMQS/IO-Compress-Lzop-2.055.tar.gz)
Module < IO::Uncompress::Adapter::Lzf (PMQS/IO-Compress-Lzf-2.055.tar.gz)
Module = IO::Uncompress::Adapter::UnLzma (PMQS/IO-Compress-Lzma-2.055.tar.gz)
Module = IO::Uncompress::Adapter::UnXz (PMQS/IO-Compress-Lzma-2.055.tar.gz)
Module = IO::Uncompress::AnyInflate (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::AnyUncompress (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Base (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Bunzip2 (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Gunzip (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::Inflate (PMQS/IO-Compress-2.055.tar.gz)
Module = IO::Uncompress::RawInflate (PMQS/IO-Compress-2.055.tar.gz)
Module < IO::Uncompress::UnLzf (PMQS/IO-Compress-Lzf-2.055.tar.gz)
Module = IO::Uncompress::UnLzma (PMQS/IO-Compress-Lzma-2.055.tar.gz)
Module < IO::Uncompress::UnLzop (PMQS/IO-Compress-Lzop-2.055.tar.gz)
Module = IO::Uncompress::UnXz (PMQS/IO-Compress-Lzma-2.055.tar.gz)
Module = IO::Uncompress::Unzip (PMQS/IO-Compress-2.055.tar.gz)
19 items found
2012-10-22T14:33:50 GwenDragonKann jemand das Problem mit Strawberry Win32 odr ActiveState und meinem LWP-Code bestätigen?
2012-10-22T15:52:19 GwenDragonProbier mal /bat/poard/message/162720/code/code_162720_1.txt
QuoteCache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 16:17:07 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 1038
Content-Type: text/html
Expires: Mon, 22 Oct 2012 18:17:07 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 16:17:10 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=716
X-Powered-By: Perl
2012-10-22T16:41:28 GwenDragonAha, bei dir kommt im Header das Encoding gzip.
Danke.
2012-10-22T17:10:26 GwenDragondie aktuel...