Greetings,

I used CPAN (libwww-perl) docs as my main reference
and generated the following script (trying 'content'
as well as 'authorization_basic' for user id & pw),
but keep getting "405 Method Not Allowed".

I would very much appreciate any suggestions.

Cheers,
David

#!perl -w
use LWP::UserAgent;
use HTTP::Cookies;

$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file =>
"lwpcookies.txt", autosave => 1));

# Create a request
my $req = HTTP::Request->new(POST =>
'http://www.gene-regulation.com/');
$req->content_type('application/x-www-form-urlencoded');

# Login
# $req->content('user=gratner&password=motley');
$req->authorization_basic('gratner', 'motley');

# Pass request to the user agent and get a response
back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
    open (OUT, ">out.html");
    print OUT $res->content;
}
else {
    print $res->status_line, "\n";
}



__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to