Hi im new to perl..I normally code java...but the boss got me trying to fix this issue...

Anyway,we get a news feed that comes in as an xml file...this feed now requires "basic HTTP authentication"...the old feed didint require this , so there was nothing implemented in the code, ...anyway this is the code that's giving me the error..the feed people sent me a username and password....how and where should I implement it??....thanx in advance

my $article_xml_url = $article->getElementsByTagName('XMLPAGEURL')->item(0)->getFirstChild->getNodeValue;
                my $req = HTTP::Request->new( GET => $article_xml_url );
                $req->header('Accept' => 'text/xml');
                my $res = $ua->request($req);

                $res->status_line =~ m/^(\d\d\d) (.*?)$/;
                ($status_code,$status_message) = ($1, $2);
                if ( ! $res->is_success ) {
                        $errors = "Error fetching news article ($article_xml_url) from XML newsfeed: " . $res->status_line . "\n";
9 Years
Discussion Span
Last Post by KevinADC

Look in the HTTP::Request modules documentation and see if has some authentication method. Or look in the documentation of other modules your script might use, like LWP or LWP::Simple or whatever.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.