Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Need to test HTTP page responses

by sugarboy (Beadle)
on Oct 22, 2008 at 12:50 UTC ( [id://718735]=note: print w/replies, xml ) Need Help??


in reply to Need to test HTTP page responses

The required test can be easily achieved by using Test::WWW::Mechanize with Test::More, where it accesses the URL and it Checks for the response codes being returned.

Example Code looks like:

use Test::More tests => 1;
use Test::WWW::Mechanize
$mech->Test::WWW::Mechanize->new;
$mech=get_ok(URL);

The response it return will be as follows:
ok - Got <<URL>> ok

Thanks,
Sagar

Replies are listed 'Best First'.
Re^2: Need to test HTTP page responses
by Anonymous Monk on Oct 22, 2008 at 14:14 UTC
    Thanks all for your help so far.

    I've added the LWP::Debug to the script and for some reason every request is coming through as

    LWP::UserAgent::new: ()
    LWP::UserAgent::request: ()
    LWP::UserAgent::send_request: HEAD http://bonnard/home.do/
    LWP::UserAgent::_need_proxy: Not proxied
    LWP::Protocol::http::request: ()
    LWP::UserAgent::request: Simple response: Internal Server Error
    http://bonnard/home.do/: 500

    SO need to look into Proxies now me thinks...

    Ant

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://718735]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found