Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    11

    Unanswered: Health Check of URL

    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

  2. #2
    Join Date
    Feb 2006
    Posts
    56
    Look into using WWW::Mechanize.

  3. #3
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    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://userassword@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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •