senthil_v has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

Can you please any one tel me to resolve this URL checking, I can check the URL status about this types URL, as follows

http://en.wikipedia.org,http://en.wikipedia.org/perl_language

But i cant check the POST type URL is valid or not for this types of URL. this URL contains twiki page as follows

http://en.wikipedia.org/twiki/Perl_language

My code:

use LWP::UserAgent; my $ua = LWP::UserAgent->new; $common_prefix = "http://wiki-na.ms.com/twiki/pub1/GLOSKM/"; $common_prefix = $common_prefix."$each_items[1]/"."$each_items +[4]"; $url_part = $common_prefix; print "$url_part\n"; $response = $ua->get($url_part); if ($response->is_success) { $worksheet1->write($rows, 0, $rows); $worksheet1->write($rows, 1, $url_part); $worksheet1->write($rows, 2, 'Yes'); } else { $worksheet1->write($rows, 0, $rows); $worksheet1->write($rows, 1, $url_part); $worksheet1->write($rows, 2, 'No'); } $rows++; } }

Thanks & Regards,

Senthil. V

Replies are listed 'Best First'.
Re: URL checking
by Corion (Patriarch) on Apr 26, 2012 at 11:27 UTC

    So, where and how do you check the "POST URL"? You will need to make a POST request to find out whether a POST URL actually answers to something.

    Maybe now is a good time to learn about HTML and HTTP and how they fit together?

Re: URL checking
by JavaFan (Canon) on Apr 26, 2012 at 11:35 UTC
    As Corion said. Although, that only give you whether or not you have the ability to POST to the given URL at that specific moment in time, from your box, using your credentials and with the given parameters.

    Lots of pages I write return a HTTP error (including, but not limited to, 404) if credentials fail, the request is malformatted, parameters are missing, or the moon isn't blue enough.