Bonjour,
Je parse des fichiers XML avec XML::XPath.
En temps normal pas de problemes j'utilise LWP::Simple
my $link = "http://www.popo.com/popo.xml";
my $document = get($link);
my $xp = XML::XPath->new(xml => $document);
Mais pour acceder a certain fichiers XML il y a une authentification donc :
my $link = "http://www.popo.com/popo.xml";
my $ua = LWP::UserAgent->new;
$req = HTTP::Request->new(GET => $link);
$req->authorization_basic('login', 'password');
$document = $ua->request($req)->as_string;
my $xp = XML::XPath->new(filename => $document);
l'authentification se deroule bien mais le texte du fichier XML est renvoyé a l'écran et XML::XPath renvoie une erreur ligne 53 !!
quelqu'un sait pourquoi ????
Merci
Partager