Thread Regex matched nicht
(24 answers)
Opened by FlorianL at 2008-03-13 15:51
Hab jetzt cpan und vor allem lwp auf den neuesten stand gebracht und bekome den fehler nicht mehr.
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 #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use HTTP::Request; my $req = HTTP::Request->new( POST => "http://www-912.ibm.com/eserver/support/fixes/fixcentral/pfixpacks/53", [ tl => 'all', ], ); my $proxy = 'http://suma:***@svproxsg01.***.de:8080/'; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->proxy(['http','ftp'], $proxy) if defined $proxy; push @{ $ua->requests_redirectable }, 'POST'; my $response = $ua->request( $req ); print $response->status_line . "\n"; print $response->content . "\n"; Das lässt sich ausführen, der Output: Augenscheinlich muss ich also noch Content-lenght mit angeben, aber ich find in der lwp-doc keine info ?! Many responses contain a Content-Length line that specifies the length, in bytes, of the body. However, this line is rarely present on dynamically generated pages, and because you never know which pages are dynamically generated, you can't rely on that header line being there. (Other, rarer header lines are used for specifying that the content has moved to a given URL, or that the server wants the browser to send HTTP cookies, and so on; however, these things are generally handled for you automatically by LWP.) [b] |