David Byrne wrote:
Dear Wiggins,
Thank you for your reply. It is true that the /login resolves the '405' error, but the updated script doesn't seem to log me in; instead I remain at the login page. If I try to GET another URL within the site, I get '403 Forbidden'.
From that URL, upon login, I should be redirected tohttp://www.gene-regulation.com/index.html where I can GET to any other URL.
I am not terribly familar with using the cookie jar, you don't do any error checking of setting the file, etc. That would be the first place I would look, I assume you know that the site utilizes cookies for authentication purposes? I also didn't see specifically a URL to test with that was "protected" (though I only made a cursory glance) and didn't login with your account assuming that username and password isn't spoofed. Double check your URLs, etc.
Any one else have some thoughts?
http://danconia.org
--- Wiggins d Anconia <[EMAIL PROTECTED]> wrote:
$req->content_type('application/x-www-form-urlencoded');
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".
'Method not allowed' is usually provided when you try a POST and need a GET or vice versa, however, in this case I believe you are getting that because you are not POST'ing to the login url, but to the home page instead. See below...
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/');
The above needs a 'login' tacked onto the end so you are submitting your content to the actual login script not to the homepage.
# Login # $req->content('user=gratner&password=motley');
The above should be what you need.
Does that get it?
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]