in reply to http POST + authentication

I could be wrong because I didn't try it but I think you mean:

use HTTP::Request::Common; use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->credentials('user', 'password'); my $req = new HTTP::Request::Common(POST $URL, # note how it is calle +d! [ 'txtUserID' => $USERID, 'txtPassword' => $PASSWORD, 'txtHeader' => $header, 'txtReportArea' => $data, 'onbtnSubmitReportWebEvent(btnSubmitReport)' => 'Submit Report +' ]); $req->authorization_basic('aas', 'mypassword'); print $req->status_line, "\n";

Replies are listed 'Best First'.
Re: Re: http POST + authentication
by CountZero (Bishop) on Dec 30, 2002 at 18:28 UTC

    In the docs of LWP::UserAgent I read:

    $ua->credentials($netloc, $realm, $uname, $pass)
    Set the user name and password to be used for a realm.

    So it seems that you need to furnish the realm (i.e. the name of the protected area of the website)and the "netloc" (whatever that may be).

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      I saw that looking through the libwww-perl mailing list archives, here's what they look like:
      $ua->credentials(< 'servername:portnumber', 'realm-name', 'username' => 'password' );
      NOTE: You have to specify the port number above!
        Yarg... With the credentials piece, the final solution was already in my hand. A boneheaded developer at the other end included a hidden form element with value="PLACEHOLDER_NOTUSEDANYMORE" and decided that this was a required field, not excepting the form without it.

        thanks all for your help!!
        Grateful_Dude
Re: Re: http POST + authentication
by JamesNC (Chaplain) on Dec 30, 2002 at 18:18 UTC
    yep...I missed that too... need to declare that module.. you should also probably add the following to all your code:
    #!\perl\bin\perl -w use strict;
    It will save you lots of headaches and force you to code better. :0)
Re: Re: http POST + authentication
by Anonymous Monk on Dec 31, 2002 at 10:21 UTC

    You are wrong. LWP uses HTTP::Request::Common so you don't need to do this as it has already been imported.