http://www.perlmonks.org?node_id=1013814


in reply to Re^5: Seeking assistance with WWW::Mechanize Form Submission
in thread Seeking assistance with WWW::Mechanize Form Submission

using these 3 variations:
$data=$mech->submit_form( form_name => 'HashForm1', fields => { login_password => 'password', login_username => 'username', prefLanguage => 00000000, submit => 'Log On', } );
and this
$mech->submit_form( form_name => 'HashForm1', fields => { login_password => 'password', login_username => 'username', prefLanguage => 00000000, }, button => "submit", );
and this
$mech->form_name('HashForm1'); $mech->field("login_username",'username'); $mech->field("login_password",'password'); $mech->field("prefLanguage",00000000); $mech->submit_form();

all yield the same 500 error. Trying to record the tranactions using httprecorder with the follwing line yields a 403

$mech->proxy(['https'], 'http://localhost:8080');

but it does yield this in the log:

$agent->get('https://192.168.0.2'); $agent->get('https://192.168.0.2/home.htm'); $agent->get('https://192.168.0.2/logon.htm');

I have tried all of the different combinations of submitting the post data as well, even though that seemed like the least likely way to resolve the problem. Is it possible something in the headers isn't being set that would prevent log in? This seems like such a simple task and yet its turning out to be quite difficult.