Quote:
|
Originally Posted by unixshell
Hi All,
Could you please help me to know how to check whether the URL is up and running via perl code and if that URL is requires login name and password then how to pass the login name and password to that URL.
Thanks
|
Kev got the first part of your question, so to the second part, there are three methods.
1. most common URI formats, like HTTP and FTP, allow you to say
http://user
assword@domain.com/blah/blah/blah. (Try it on a site that requires login, it'll skip the stupid dialog.)
2.
RTFM about the URI class. It provides the userinfo method that allows you to set the username and password. This does the exact same thing as #1.
3. WWW::Mechanize has a credentials method which it inherits from LWP::UserAgent.
If a site requires user/pass through a form, you need to simulate submitting the form. That's more complicated. HTTP::Request::Form might help here.