Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by KM (Priest)
on Oct 12, 2000 at 21:00 UTC ( #36438=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How do I retrieve .htpasswd protected html documents? - Answer 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 studying the Monastery: (11)
As of 2016-08-31 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (431 votes). Check out past polls.