If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > Health Check of URL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-07, 01:02
unixshell unixshell is offline
Registered User
 
Join Date: Feb 2005
Posts: 11
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
Reply With Quote
  #2 (permalink)  
Old 07-18-07, 15:34
KevinADC KevinADC is offline
Registered User
 
Join Date: Feb 2006
Posts: 56
Look into using WWW::Mechanize.
Reply With Quote
  #3 (permalink)  
Old 07-21-07, 00:09
sco08y sco08y is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On