use LWP::UserAgent; $ua = new LWP::UserAgent; $req = new HTTP::Request GET => 'http://www.sn.no/secret/'; $req->authorization_basic('aas', 'mypassword'); print $ua->request($req)->as_string; # the above code returns the html code for the form #### use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->credentials('user', 'password'); my $req = HTTP::Request::Common::POST($URL, [ 'txtUserID' => $USERID, 'txtPassword' => $PASSWORD, 'txtHeader' => $header, 'txtReportArea' => $data, 'onbtnSubmitReportWebEvent(btnSubmitReport)' => 'Submit Report' ]); $req->authorization_basic('aas', 'mypassword'); print $req->status_line, "\n"; # the above returns 401 Access Denied