Thread LWP::UserAgent und 401 Unauthorized
(45 answers)
Opened by bianca at 2013-06-12 21:07 2013-06-14T08:52:05 jan Hatte ich bereits, das ändert leider nichts. 2013-06-14T08:52:05 jan Siehe unten das komplette Script ohne unnötige Sachen: 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 #!/usr/bin/perl require 5.010_001; use strict; use warnings; use Data::Dumper; use JSON; use LWP::UserAgent 6.03; my $inhalt; my $url = 'https://dev.sepatools.eu/supported_banks.json'; my $ua = LWP::UserAgent->new(); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->ssl_opts('verify_hostname' => 0); $ua->credentials('dev.sepatools.eu:443',"dev.sepatools.eu",'***','***'); my $response = $ua->get($url); if ($response->is_success) { my $content = $response->content; my $ref = JSON->new->utf8->decode($content); $inhalt = 'Ergebnis:<br><pre>'.Dumper($ref).'</pre>'; } else { $inhalt = 'Fehler: "'.($response->status_line).'"'; } print $inhalt; 10 print "Hallo"
20 goto 10 |