Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Answer: How do I retrieve .htpasswd protected html documents?

( #36438=categorized answer: print w/ replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How do I retrieve .htpasswd protected html documents? contributed by KM

Yes, you sure can. Use LWP::UserAgent:

use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = new HTTP::Request 'GET', 'http://www.you.com/dir'; $req->authorization_basic('userid', 'password'); my $result = $ua->request($req)->as_string;

Read the POD for the module, as well as lwp-cook for other options/uses.

Cheers,
KM

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2016-06-26 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (332 votes). Check out past polls.