Thread LWP und proxy (52 answers)
Opened by perl-snaks at 2012-04-25 13:04

perl-snaks
 2012-04-25 16:26
#157844 #157844
User since
2012-04-19
54 articles
BenutzerIn
[default_avatar]
Ich habe die beiden zeilen in meinem Skript hinzugefĆ¼gt sieht dann so aus:

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
#!C:\Perl\bin\Perl.exe -w

print "Content-type:text/html\n\n";

use strict;
use LWP::UserAgent;
use LWP::Debug qw(+);

my $pw='abcdefg';
my $us='123456';

my $url = "https://xyz.server.eu/lala.php";

my $ua = LWP::UserAgent->new;
 
   $ua->timeout(10);
   $ua->requests_redirectable(undef); # Redirects ausschalten!
 
   $ua->credentials("++++.******.de:443", "Realname", $us, $pw);
   
   $ua->add_handler("request_send",  sub { shift->dump; return });
   $ua->add_handler("response_done", sub { shift->dump; return });
 
my $response = $ua->post($url,[0=>0]);
   print $response->status_line;
   print $response->decoded_content; 



und bekomme die fhlermeldung:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Content-type:text/html

User-Agent: libwww-perl/6.02
Content-Length: 3
Content-Type: application/x-www-form-urlencoded
0=0
500 Can't connect to xyz.server.de (Bad hostname)\n
Content-Type: text/plain
Client-Date: Wed, 25 Apr 2012 14:18:33 GMT
Client-Warning: Internal response


Can't connect to xyz.server.de(Bad hostname)\n
LWP::Protocol::https::Socket: Bad hostname xyz.server.de ' at C:/Perl/liProtocol/http.pm line 51.\n




[i][b]modedit[/b] Editiert von [user]642[/user]: CODE-Tags repariert[/i]

Last edited: 2012-05-31 13:19:55 +0200 (CEST)

View full thread LWP und proxy