Thread Dekomprimierung in HTTP::Message aussschalten (14 answers)
Opened by GwenDragon at 2010-04-26 14:23

GwenDragon
 2010-04-26 14:23
#136460 #136460
User since
2005-01-17
14761 Artikel
Admin1
[Homepage]
user image
Ich verwende CPAN:LWP, um einen Server abzufragen, was er sendet, wenn der Browser dekomprimieren kann.
Ich will eigentlich den Binärcontent empfangen und nicht den dekomprimierten.

Wie kann ich das automatische dekomprimieren in CPAN:HTTP::Message ausschalten?

Code (perl): (dl )
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
use strict;
use warnings;
use LWP;

my $DEBUG = 1;

my $browser = LWP::UserAgent->new;
my $can_accept = HTTP::Message::decodable;

my $url = 'http://www.gwendragon.de/css/standard.css';

my $response = $browser->get($url,
   #'User-Agent' => 'Opera/9.60 (Windows NT 5.1; U; de) Presto/2.1.1',
   #'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)',
   'User-Agent' => 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100401 Ubuntu/9.10 (karmic) Firefox/3.5.9',
   #'User-Agent' => 'Mozilla/4.06 (compatible; MSIE 4.06; Windows 95)',
   'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*',
   'Accept-Charset' => 'iso-8859-1,*,utf-8',
   'Accept-Language' => 'de-DE',
   'Accept-Encoding' => 'gzip',
  );
  
$DEBUG && print "DEBUG#### ", $can_accept, "\n";

print "GET ", $response->request->uri->as_string, "\n",
      $response->request->headers_as_string, "\n",
          $response->content;

View full thread Dekomprimierung in HTTP::Message aussschalten